# A timing attack on Codecrypt

Codecrypt

Codecrypt is a software developed by Miroslav ‘Mirek’ Kratochvil (@__exa__). From the documentation of codecrypt:

This is a GnuPG-like unix program for encryption and signing that uses only quantum-computer-resistant algorithms:

• McEliece cryptosystem (compact QC-MDPC variant) for encryption
• Hash-based Merkle tree algorithm (FMTSeq variant) for digital signatures

Scribbles on timing attack on codecrypt:

1. Message recovery: The error weight (when below correction bound) determines the time it takes to decrypt a block. Flip bits in encrypted block and note when decryption time decreases. Takes $n \cdot w$, were $n$ is dimension and $w$ error weight. Adaptive known-ciphertext attack. The timing attack is briefly investigated here.
2. Key recovery: Basically the same principle as above, but we choose ciphertexts adaptively and use the decoding to determine which bits are set in the private key. TODO: formulate a clear description.

Addition: There is a result on the key recovery here!
{"ft_lang_label":"__label__en","ft_lang_prob":0.8668948,"math_prob":0.9583565,"size":987,"snap":"2019-51-2020-05","text_gpt3_token_len":214,"char_repetition_ratio":0.102746695,"word_repetition_ratio":0.0,"special_character_ratio":0.1904762,"punctuation_ratio":0.10909091,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9508304,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-22T02:38:45Z\",\"WARC-Record-ID\":\"<urn:uuid:f766efc9-7636-42bd-a7e2-aa0989f9d3d6>\",\"Content-Length\":\"65944\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f672c7e5-51c5-4e20-b3a3-5f1c070137b6>\",\"WARC-Concurrent-To\":\"<urn:uuid:2afe27df-422f-4889-9560-21efae9048ca>\",\"WARC-IP-Address\":\"192.0.78.25\",\"WARC-Target-URI\":\"https://grocid.net/2016/04/14/a-timing-attack-on-codecrypt/\",\"WARC-Payload-Digest\":\"sha1:FBLQ7CRUCGI3FXN7S3JJ6BQJSQAM6E57\",\"WARC-Block-Digest\":\"sha1:AHKGAPAVO2TV2VG5SECXGTIFTHIK2M5Q\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250606269.37_warc_CC-MAIN-20200122012204-20200122041204-00103.warc.gz\"}"}