Implementing OpenSSL simple encryption and decryption string under Linux
Scene
Clear text password exists in shell script
Customers require that the use of plaintext passwords and passwords for encryption are prohibited.
Scheme
Learned about the Linux OpenSSL encryption and decryption tool on the Internet.
Can specify a variety of encryption algorithms for characters, files for encryption processing.
There are many cases of encryption and few cases of decryption.
If you are interested, you can check the Chinese course.
The encryption algorithm is used in the case: AES
Example
# # all commands are executed in Linux # check whether the tool is installed in my environment. The article does not describe the installation # # openssl## encryption (get a password after execution) # # echo abc | openssl aes-128-cbc-k 123-base64## decryption (password is too long, indicated by *) # # echo * | openssl aes-128-cbc-d-k 123-base64