The need of encryption is very very common in today's world. Many-a-times one needs to encrypt some text, password or even some paragraphs at times for respective needs. Encryption gives you certain peace of mind that eavesdroppers won't be able to read the content, and it can only be deciphered by someone who has the key.
Let's look at a simple yet robust working solution of a text / string encryption & decryption algorithm.
You need to define a key for the encryption. AES only supports key sizes of 16, 24 or 32 bytes.
Following is the code for encryption of the input text
And here goes the logic for decryption of encrypted text
Note: The key is required both for encryption and decryption
0 comments:
Post a Comment