Encrypt and Decrypt a File using Symmetric Encryption

To encrypt:

openssl enc -aes-256-cbc -salt -in archive.tar.xz -out archive.tar.xz.aes

To decrypt:

openssl enc -d -aes-256-cbc -in archive.tar.xz.aes -out archive.tar.xz

Create a Self-Signed Certificate

  • Generate the private key:
openssl genrsa -des3 -out server.key 1024
  • Create a certificate signing request (CSR):
openssl req -key server.key -out server.csr
  • Sign the certificate signing request (CSR):
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  • Remove the passphrase from the private key (for apache to not prompt):
cp server.key server.key.secure
openssl rsa -in server.key.secure -out server.key


To benchmark an OpenSSL encryption scheme, for example aes-256-cbc, issue the following command:

openssl speed -evp aes-256-cbc

Check PEM Encoded Certificate Expiration

openssl x509 -enddate -noout -in cert.pem


  • cert.pem is the certificate

fuss/openssl.txt ยท Last modified: 2019/02/08 00:37 by office

Access website using Tor Access website using i2p

For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.