Paul T. Rykiel
Paul T. Rykiel

Reputation: 1227

Do I have to store my encryption Keys, in order to Decrypt my strings?

this is more of a question ... I am using AES encryption/decryption. I completely understand that the key is generated and the IV is generated during the encryption routine and in order to decrypt my string I need to use the same process (key and IV), so my question is do I need to store and pass those two elements (key and IV along with my encrypted string)? Or is there a way to create a key and iv generically?

Upvotes: 1

Views: 44

Answers (1)

oleksii
oleksii

Reputation: 35925

If you use AES, you must have the same key and IV to decrypt data. You shouldn't look for any option to make your key or IV predictable. That is, if you can easily re-generate it, guess what?..

You probably want to post what you trying to achieve. Seems like AES may not be the right choice. You may need to look at public-private key cryptography, where one key encrypts, the other decrypts. You may also want to use a holistic solution that includes several steps.

Upvotes: 1

Related Questions