I have 2 methods to generate 2 different data and need to save them in one encrypted file.
Can I achieve this by adding encrypted stringA + encrypted stringB, then decrypt them later?
Or
I have to encrpt stringA -> save as file -> read the file & decrypt to stringA ->
stringA + stringB -> encrypt ?
NB, I am using Rijndael(AES) and someone suggested using customerized stream, will it work?
Any thoughts?
Many thanks~
If you’re using ECB (electronic code book), then it should be possible (assuming they use the same encryption key), because each block is decrypted independent of other blocks. If you’re using CBC (cipher block chaining) this will not work because each block is encrypted using data from the previous block. However, using ECB is way less secure than CBC.