Skip to content
Cipher utilities using openssl
Emacs Lisp Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
Makefile
README.md
openssl-cipher-test.el
openssl-cipher.el

README.md

openssl-cipher.el

openssl-cipher is a library to encrypt/decrypt string or file with openssl command.

Install:

  1. Install openssl command to your system by apt, yum... whatever you desire.

Source code: http://www.openssl.org/source/

  1. Put this file into load-path'ed directory, and byte compile it if desired. And put the following expression into your ~/.emacs.

    (require 'openssl-cipher)

Usage:

  • To encrypt a well encoded string (High level API)

openssl-cipher-encrypt-string <-> openssl-cipher-decrypt-string

  • To encrypt a binary string (Middle level API)

openssl-cipher-encrypt-unibytes <-> openssl-cipher-decrypt-unibytes

  • To encrypt a binary string (Low level API)

openssl-cipher-encrypt <-> openssl-cipher-decrypt

  • To encrypt a file

openssl-cipher-encrypt-file <-> openssl-cipher-decrypt-file

Sample:

  • To encrypt my secret Please ensure that do not forget clear-string you want to hide.

    (defvar my-secret nil)
    
    (let ((raw-string "My Secret"))
      (setq my-secret (openssl-cipher-encrypt-string raw-string))
      (clear-string raw-string))
    
  • To decrypt my-secret

      (openssl-cipher-decrypt-string my-secret)
    
You can’t perform that action at this time.