From Just Solve the File Format Problem
Jump to: navigation, search
File Format
Name Codecrypt
Extension(s) .ccr
Released 2013[1]

Codecrypt (shortened to CCR) is a software tool, and format, that performs "post-quantum" cryptography. It functions like a stripped-down version of PGP; users have a keyring of their private and other peoples' public keys, and they are able to sign things with their private keys, encrypt things to public keys, etc. It was created by Miroslav Kratochvíl for a bachelor's thesis.[2]

Codecrypt can produce symmetrically- as well as asymmetrically-encrypted files. Its signature system, FMTSeq[3][4], requires a limit (by default, 65535, i.e. 2^16-1) on the number of signatures a signing key can make.


Post-Quantum Cryptography

A quantum computer is a computer, constructed with knowledge recent developments in physics, which is able to solve some problems more efficiently than a "classical" computer. Several classes of problems are in the area of cryptography. In particular, a practical quantum computer would be able to break all presently widely-used public-key cryptography systems. However, practical quantum computers have not yet been developed; there is public research that occasionally makes the news for a development, and presumably a lot of secret government work, but, so far, there is nothing useful that a quantum computer can do that a "classical" one cannot. More information can be found at Wikipedia:Post-quantum cryptography, as well as this wiki's pages on quantum computers and encryption.

Codecrypt is one of several pieces of software developed with what is intended to be quantum-computer-safe cryptography, but before quantum computers become an immediate threat. It seems plausible that Codecrypt will only see use during this interim period, especially if some the algorithms it uses are shown to be insecure, and because more popular systems like PGP and TLS are flexible enough to have sufficiently mature post-quantum encryption algorithms added in, once the threat becomes pressing enough.


Codecrypt does not add an extension to files by default, but the documentation uses the extension ".ccr" in examples.


Codecrypt files are divided into sections, each of which start with the character 's' (ASCII), the content length as a decimal string, a colon character, and then the binary data of that section.[5] The first section will always be an identifier of the subtype of file, which is a string starting with "CCR-". Files produced by the current version of Codecrypt will therefore start with:

  • s22:CCR-PRIVATE-KEY-FMTSEQ [6]:334
  • s21:CCR-PUBLIC-KEY-FMTSEQ [6]:416
  • s20:CCR-ENCRYPTED-MSG-v2 [6]:451
  • s17:CCR-SIGNED-MSG-v2 [6]:481
  • s12:CCR-HASHFILE [6]:525
  • s10:CCR-SYMKEY [6]:583

It can be inferred that either s20:CCR-ENCRYPTED-MSG-v1 and s17:CCR-SIGNED-MSG-v1 or s17:CCR-ENCRYPTED-MSG and s14:CCR-SIGNED-MSG also existed at some point.


Like PGP, CCR also has an ASCII-armored format. Codecrypt's ASCII-armored files begin with a line consisting of ------ccr begin ------[7]



  3. Dalit Naor, Amir Shenhav, Avishai Wool, "One-Time Signatures Revisited: Practical Fast Signatures Using Fractal Merkle Tree Traversal", 2006 IEEE 24th Convention of Electrical and Electronics Engineers in Israel, online at
  4. Source →
  5. Source → secncode.cpp → sencode_bytes::encode()
  6. 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 Source → secncode.cpp → serialization.cpp as of commit 8e608b4d8da122abd0aceb0cb1dfc4faae95a286
  7. Source → envelope.cpp → envelope_read()
Personal tools