Johnny2

OpenSSL_Command_Line_Encryption-Decryption_examples

Nov 6th, 2021
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. OpenSSL_Command_Line_Encryption-Decryption_examples
  2.  
  3. Encrypt
  4. $ echo "A Quick Brown Fox Jumped Over the Grey Lazy Dog" | openssl enc -e -base64 -aes-256-ctr -nosalt -pbkdf2 -k secret_password
  5. vcrAQFIMfJjMUxtG0sVQDPDhpriPU17TiwxwaddPVhhFj/XUxK6rPaG6T5SIrFNJ
  6.  
  7. Decrypt
  8. $ echo "vcrAQFIMfJjMUxtG0sVQDPDhpriPU17TiwxwaddPVhhFj/XUxK6rPaG6T5SIrFNJ" | openssl enc -d -base64 -aes-256-ctr -nosalt -pbkdf2 -k secret_password
  9. A Quick Brown Fox Jumped Over the Grey Lazy Dog
  10.  
  11. Encrypt
  12. $ openssl enc -aes-256-cbc -salt -a -in file.txt -out file.txt.enc -k PASS
  13.  
  14. To encrypt file in Base64-encode, you should add -a option:
  15.  
  16. Decrypt
  17. $ openssl enc -aes-256-cbc -d -a -in file.txt.enc -out file.txt -k PASS
  18.  
Add Comment
Please, Sign In to add comment