PostQuantum Cryptography (PQCrypto)
From Whonix
(Redirected from Codecrypt)
In ~10 years Quantum Computers will break todays common asymmetric publickey cryptography algorithms used for web encryption (https), email encryption (gnupg...), ssh and others.
Introduction[edit]
Quantum computers ^{[archive]} are based on the phenomena of quantum mechanics ^{[archive]}, as opposed to familiar classical computers based on transistors which encode data into binary digits (bits). In traditional computing, this process always leads to one of two possible states (0 or 1). ^{[1]} However, quantum computation relies on qubits ^{[archive]} that can express many different states simultaneously ("superpositions"), meaning that when/if this technology is fully developed, it will be capable of solving some types of mathematical problems virtually instantaneously. ^{[2]} ^{[3]}
Assembling a quantum computer is now an engineering problem rather than one impeded by laws of physics  a theoretically imperfect machine can still yield useful results. Military and government agencies have invested heavily in this area because of the implications for today's widely used publickey cryptography. ^{[4]} Ciphertext that is invulnerable to classical computing will be shredded into ribbons by a largescale quantum computer. Similarly, all Tor traffic will be vulnerable until quantumresistant cryptography is implemented.
The Snowden documents reveal that all encrypted data traversing the internet is intercepted and stored indefinitely for cryptanalysis should there be a scientific breakthrough. A global arms race has ensued between the United States, EU, Russia, China, Israel and other global powers due to the immense geopolitical, economic, intelligence and military advantages this technology would confer.
The academic and corporate consensus is that a large quantum computer will be built in around 1015 years. It is safe to assume that wellfunded intelligence communities are capable of greatly reducing this development period.
As of July 2020, the second round ^{[archive]} of NIST PQ cipher standardization has concluded. The 26 candidates are grouped into finalist and alternate ^{[archive]} groups which will be reviewed for another 1218 months. NIST plans to release the initial standard for quantumresistant cryptography in 2022 ^{[archive]}. The finalist group has better performance, but less security confidence while alternate candidates have a stronger security rationale, but lack performance for all use cases. Only one cipher of each design type will be standardized, for example one lattice based asymmetric crypto and one lattice based signature scheme will be selected out of the group. A fourth round looking at alternates for standardization is planned.
Broken and Impacted Cryptographic Algorithms[edit]
The US National Institute of Standards and Technology has summarized the impact of quantum computing ^{[archive]} on common cryptographic algorithms.
Table: Cryptographic Impacts of Quantum Computing
Cryptographic Algorithm  Type  Purpose  Quantum Computer Impact 

AES256  Symmetric Key  Encryption  Larger Key Sizes Needed 
SHA256. SHA3    Hash Functions  Larger Output Needed 
RSA  Public Key  Signatures, Key Establishment  No Longer Secure 
ECDSA, ECDH ^{[5]}  Public Key  Signatures, Key Exchange  No Longer Secure 
DSA ^{[6]}  Public Key  Signatures, Key Exchange  No Longer Secure 
The emergence of quantum computers would break all asymmetric publickey cryptography and signature algorithms used today  the type of cryptography that protects communications over the internet. The size of symmetric keys is also halved, meaning the strength of 256bit keys would be equivalent to 128bit keys. This is the type of cryptography used for Full Disk Encryption, when data is encrypted with a passphrase.
All current generation symmetric cryptographic authenticated modes such as CBCMAC, PMAC, GMAC, GCM, and OCB are completely broken. This also applies to many CAESAR competition candidates: CLOC, AEZ, COPA, OTR, POET, OMD, and Minalpher. ^{[7]}
For more details visit https://pqcrypto.org/ ^{[archive]}
Postquantum Cryptography[edit]
The solution to this threat is Postquantum Cryptography ("PQ Crypto"). This provides a dropin replacement for cryptographic libraries already deployed, except different types of "quantumhard" mathematical problems are used so cryptanalysis is difficult for both classical and quantum computers.
Competent cryptographers are gradually improving the performance of PQ Crypto and designing ciphersuites that are efficient for everyday use. For instance:
 Initial recommendations ^{[archive]} for PQ Crypto algorithms were published in September 2015.
 The Tor Project is planning to migrate to quantumresistant ciphers ^{[archive]} in a future version. ^{[8]} To follow Tor child tickets related to this transition, see here ^{[archive]}. Progress has stalled ^{[archive]} until wider cell sizes are implemented.
Software[edit]
The Free Software listed below is known to resist quantum computers, but this is not an endorsement for any particular tool. To mitigate potential exposure to unknown software implementation failures, it is recommended to set up arbitrary protocols over Tor Onion Services once PQ Crypto is deployed. The exception is the use of onetime pads which are secure from an informationtheoretic perspective ^{[archive]}.
 Codecrypt ^{[archive]}
 Cyph ^{[archive]}
 OneTime ^{[archive]}
 TinySSH (PQC planned) ^{[archive]}
 liboqs ^{[archive]}  is a FLOSS implementation of many NIST candidates by Douglas Stebila, an Associate Professor of cryptography at the University of Waterloo. It provides pq for OpenSSL and OpenSSH using software.^{[9]}
Before adopting any software, first consider if: ^{[10]}
 Cryptographic libraries were written by competent cryptographers and audited for correct implementation.
 Quantumresistant algorithms have withstood substantial cryptanalytic efforts.
 The software has been widely adopted to help users blend in.
Setup Guides[edit]
Codecrypt[edit]
This is a GnuPGlike Unix program for encryption and signing that only uses quantumresistant algorithms: ^{[11]} ^{[12]}
 McEliece cryptosystem (compact QCMDPC variant) for encryption.
 Hashbased Merkle tree algorithm (FMTSeq variant) for digital signatures.
Codecrypt is free software. The code is licensed under terms of LGPL3 in order to make combinations with other tools easier.
Use Instructions[edit]
Whonix ™ includes Codecrypt by default. ^{[13]} See the Codecrypt manual page ^{[archive]} for common usecases.
Basic Commands[edit]
Generate a strong(er) asymmetric encryption key.
ccr g ENC256 N [keyname]
Generate a strong(er) signature key.
ccr g SIG256 N [keyname]
Key Management[edit]
Table: Codecrypt Key Management Commands
Category  Command 

Backup keys  It is easier to backup the ccr folder in the home directory, changing its name from/to .ccr upon restore. Enable hidden file view in the file browser to see it.

Export specified public key for sharing with contacts  If a signature key was also created, both types of keys will be exported for distribution in a single file if they share the same name.
ccr F [keyname] ap > [keyname]

Export specified private key  The F parameter chooses the key to be used. To enumerate all keys in the keyring run ccr k for public ones and ccr K for private.
ccr F [keyname] aP > [keyname]

Import a public key 
ccr ai < [contactkey]

Import a private key 
ccr aI < [myprivatekey]

Encryption/Decryption, Signing and Verification[edit]
Table: Codecrypt Encryption/Decryption, Signing and Verification Commands
Message Formatting[edit]
Even without direct Thunderbird support, it is still possible to format messages to account for replies. However users should be careful to not mistakenly send unencrypted replies. It is advisable to disable the Internet connection temporarily to prevent the accidental sending of messages before they are encrypted with Codecrypt, and because TorBirdy is no longer available to automatically disable draft syncing on the host email server.
Steps:
 Disable the Internet connection.
 Click reply in Thunderbird and copy the string "John Doe:"
 Format the correspondent's text as a reply by pasting it:
Edit
→Paste As Quotation
 Copy the result to the text editor window. Continue composing the message with your replies interspersed between the quotes.
 Save and encrypt.
 Paste the ciphertext into the Thunderbird reply window and completely replace the existing text.
 Reestablish the Internet connection, then press send.
OneTime[edit]
Onetime pads are the only provably unbreakable encryption scheme ever invented, assuming a functional and nonbackdoored random number generator (RNG). ^{[17]} ^{[18]} OneTime ^{[archive]} ^{[19]} is a program that sets up a onetime pad on a user's computer, and helps to protect from reuse of pads which breaks the overall security model. OneTime is available in Debian. ^{[20]}
OneTime can encrypt any kind of file  it does not matter if the file's contents are Base64encoded or not, because OneTime is not interpreting the contents. OneTime simply treats the file as a string of bits. Notably this is true for most encryption software; OneTime is not unique in this regard.
Onetime pads should be completely secure against cryptographic attacks by quantum computers or other avenues. So long as the encryption key is truly random and the key is as long as the message, then all possible plaintexts are equally likely. Quantum computers are not telepathic, so messages properly encrypted with a onetime pad will remain impervious to cryptographic attacks. Of course, using the system is difficult in practice due to the logistics of key exchange, but quantum computing does not affect that reality. ^{[21]}
Onetime pads come with several limitations:
 The message and the key are identical in size; this issue is negated by the large size of contemporary HDD/SSDs.
 It is impossible to securely contact strangers because the pad file must be exchanged in person or by other trustworthy peers. Sending the pad online only makes it as strong as the asymmetric cryptography that is in use.
 Message integrity cannot be verified, meaning there is no way for the recipient to discover if the ciphertext was tampered with during transit.
 The old pad material must never be reused to encrypt additional different messages. If this advice is ignored, the encryption is completely broken. ^{[22]}
See also: Physical Onetime Pad.
Miscellaneous[edit]
 Forum discussion: postquantum cryptography  PQC ^{[archive]}
Footnotes[edit]
 ↑ https://en.wikipedia.org/wiki/Quantum_computer ^{[archive]}
 ↑ The technology is still reported to be in its infancy and only capable of solving basic problems, but it is developing rapidly. No problems have yet been solved faster than with a classical computer.
 ↑ For instance, a single qubit can represent a 0, 1, or quantum superposition ^{[archive]} of those two qubit states. A qubit pair can be in a superposition of 4 states, three qubits can be in a superposition of 8 states and so on. Quantum computers with n qubits can be in a superposition of 2^{n} different states simultaneously.
 ↑ Also explaining why the NSA shifted to quantumresistant cryptography ^{[archive]} in 2016.
 ↑ Elliptic Curve Cryptography.
 ↑ Finite Field Cryptography.
 ↑ Breaking Symmetric Cryptosystems using Quantum Period Finding ^{[archive]}
 ↑ Progress has been slow and this feature now has an unspecified release date, after initially being planned for Tor v0.3.X.
 ↑ https://www.douglas.stebila.ca/ ^{[archive]}
 ↑ https://forums.whonix.org/t/postquantumcryptographypqc/2011/17 ^{[archive]}
 ↑ https://gitea.blesmrt.net/exa/codecrypt ^{[archive]}
 ↑ https://exa.org/codecrypt/ ^{[archive]}
 ↑ Since Whonix ™ 14.
 ↑ https://exa.org/codecrypt/ccr.1.html ^{[archive]}
 ↑ https://archive.fosdem.org/2017/schedule/event/quantum/attachments/slides/1774/export/events/attachments/quantum/slides/1774/pqc.pdf ^{[archive]}
 ↑ https://gitea.blesmrt.net/exa/codecrypt/src/branch/master/man/ccr.1 ^{[archive]}
 ↑ https://en.wikipedia.org/wiki/Onetime_pad ^{[archive]}
 ↑ http://users.telenet.be/d.rijmenants/en/onetimepad.htm ^{[archive]}
 ↑ https://github.com/kfogel/OneTime ^{[archive]}
 ↑ https://packages.debian.org/search?searchon=names&keywords=onetime ^{[archive]}
 ↑ https://github.com/kfogel/OneTime/issues/14#issuecomment218038898 ^{[archive]}
 ↑ https://en.wikipedia.org/wiki/Venona_project#Decryption ^{[archive]}
Whonix ™ is Supported by Evolution Host DDoS Protected VPS. Stay private and get your VPS with Bitcoin or Monero.
Search engines: YaCy  Qwant  ecosia  MetaGer  peekier  Whonix ™ Wiki
This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.
Copyright (C) 2012  2021 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee ^{[archive]} of the Open Invention Network ^{[archive]}. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)
The personal opinions of moderators or contributors to the Whonix ™ project do not represent the project as a whole.
Whonix ™ is a derivative of and not affiliated with Debian ^{[archive]}. Debian is a registered trademark ^{[archive]} owned by Software in the Public Interest, Inc ^{[archive]}.
Whonix ™ is produced independently from the Tor® ^{[archive]} anonymity software and carries no guarantee from The Tor Project ^{[archive]} about quality, suitability or anything else.
By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and ESign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint, Contact.