~aritra1911/openssl_madness

159bd75ef0607465b63dc3238439a3f82b444b80 — Aritra Sarkar 2 years ago 48d61be
Initial notes on AES encryption and decryption
1 files changed, 28 insertions(+), 0 deletions(-)

M notes.txt
M notes.txt => notes.txt +28 -0
@@ 40,3 40,31 @@ $ fortune -s | /opt/openssl/bin/openssl pkeyutl -encrypt -inkey pubkey.pem -pubi
# OR : Use our own tool #

$ fortune -l | ./madness -ek pubkey.pem | ./madness -dk key.pem


#########
## AES ##
#########

❯ /opt/openssl/bin/openssl enc -aes-128-cbc -pass pass:hello -S B00B5A2D3121C8A7 -pbkdf2 -P
salt=B00B5A2D3121C8A7
key=BB2D36DF28856942C778A174DDAE79AF
iv =BF6A5178C88652023E9907A331BF1504

Yes the salt is 'BOOBSANDMINICHAT'

❯ fortune -lo | /opt/openssl/bin/openssl enc -aes-128-cbc -pass pass:hello -S B00B5A2D3121C8A7 -pbkdf2 -v -out offortune.aes_128_cbc
bufsize=8192
bytes read   :      626
bytes written:      640

❯ /opt/openssl/bin/openssl enc -aes-128-cbc -d -pass pass:hello -S B00B5A2D3121C8A7 -pbkdf2 -in offortune.aes_128_cbc
"Creation science" has not entered the curriculum for a reason so simple
 and so basic that we often forget to mention it: because it is false, and
 because good teachers understand exactly why it is false.  What could be
 more destructive of that most fragile yet most precious commodity in our
 entire intellectual heritage -- good teaching -- than a bill forcing
 honorable teachers to sully their sacred trust by granting equal treatment
 to a doctrine not only known to be false, but calculated to undermine any
 general understanding of science as an enterprise?"
          [Stephen Jay Gould, "The Skeptical Inquirer"]