Skip to content

Instantly share code, notes, and snippets.

Simple file/stream encryption using OpenSSL

Create and store a 512-byte random encryption key named secret:

$ mkkey secret

Encrypt the contents of file with the secret key and write it to file.enc:

$ encrypt secret < file > file.enc

Keybase proof

I hereby claim:

  • I am filipsalo on github.
  • I am filip (https://keybase.io/filip) on keybase.
  • I have a public key whose fingerprint is 02E7 B525 A8F2 D93D A8B6 917C 96B7 969D E0D1 9F76

To claim this, I am signing this object: