I have a use case where I want to commit symmetrically encrypted source code using GnuPG (think of Coursera assignments for backup and collaboration). I encrypt/decrypt all sources in a batch with a script and was wondering, why the output is not stable.
So basically, why does
echo "plain text" | gpg --armor --symmetric --cipher-algo AES256
secret yield different cipher texts with each call? (Surely enough, this doesn't affect the decryption – different cipher texts may decrypt back to the same plain text.)
I am not experienced with crypto algorithms, but skimming the Wikipedia article it seems the algorithm is deterministic.
So in short, my questions are:
- Is this behaviour a property of AES or am I using GnuPG incorrectly?
- If the former is the case, are there other symmetric crypto algorithms which are better suited for this use case?