/serpent

Serpent cipher in the AES contest.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

serpent

Serpent cipher in the AES contest. Used in VE475 challenge 2.

Usage

To compile

make

To generate a random key

./c2 --generate

Output (hexidecimal):

f9200a43b7eeb5e249e008e2164962dc1451ab862506c27ab801eb93113ad76c

To encrypt a message (string)

./c2 --encrypt "ve475" --key "f9200a43b7eeb5e249e008e2164962dc1451ab862506c27ab801eb93113ad76c"

Output (hexidecimal):

b94b1cc0af565b6dbace20279431f1ff

To decrypt a ciphertext(hexidecimal)

./c2 --decrypt "b94b1cc0af565b6dbace20279431f1ff" --key "f9200a43b7eeb5e249e008e2164962dc1451ab862506c27ab801eb93113ad76c"

Output (string):

ve475

Cipher

Serpent cipher is the finalist in the AES contest. For the details of algroithms, see also http://www.cl.cam.ac.uk/~rja14/Papers/serpent.pdf. We implement the cipher following the paper.

Details

  • The key length must be 256-bit. Otherwise it will be refused.
  • if no key specified, random key will be used.
  • Mode ECB for long string