This commit is contained in:
James Devine 2017-02-11 19:50:16 +01:00 committed by GitHub
parent bfdfe03baa
commit 557e958dfc

View file

@ -3,6 +3,7 @@ Specification for one time pad use.
One Time Pad must be smaller than 4Gb! One Time Pad must be smaller than 4Gb!
File format for transmission data (cyphertext): File format for transmission data (cyphertext):
Part 0 - 32 bits, the MD5 hash of the OTP used for encoding (before encoding)
Part 1 - 32 bits, indicating the address of the start bit. Part 1 - 32 bits, indicating the address of the start bit.
Part 2 - The message, no minimum length imposed. Part 2 - The message, no minimum length imposed.
@ -14,6 +15,7 @@ To ensure security, the USB stick must be connected for less than 20 minutes at
This prevents the contents being copied, as it's rather slow! This prevents the contents being copied, as it's rather slow!
Encryption process: Encryption process:
0) MD5 hash the OTP and store this in output file part 0.
1) Scan the OTP for the first 1 (binary value >0). This is the start location. 1) Scan the OTP for the first 1 (binary value >0). This is the start location.
2) Encode the start location in the first 32bits of the output file. 2) Encode the start location in the first 32bits of the output file.
3) Bitwise XOR the message with the OTP to produce the cyphertext. 3) Bitwise XOR the message with the OTP to produce the cyphertext.
@ -22,7 +24,8 @@ Encryption process:
6) Erase the original message by writing all bits to 0. 6) Erase the original message by writing all bits to 0.
Decryption Process: Decryption Process:
1) Read the first 32 bits of the cyphertext to obtain position P. 0) Compute the MD5 hash of the OTP and confirm this matches input file part 0.
1) Read the first 32 bits of the cyphertext from input file part 1 to obtain position P.
2) Go to P within the OTP. 2) Go to P within the OTP.
3) XOR the data from bits 33 onwards of the cyhertext with position P > of the OTP. 3) XOR the data from bits 33 onwards of the cyhertext with position P > of the OTP.
4) Erase all bits used in the OTP, setting to 0. 4) Erase all bits used in the OTP, setting to 0.