Skip to content

Simple exploit for multi-use keys in stream ciphers like One Time Pad

Notifications You must be signed in to change notification settings

archit-p/two-time-pad-exploit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exploit for Multi-Time Pad

Problem

Given k ciphertexts encrypted using a OTP style stream cipher using the same key, decrypt the k+1th ciphertext.

Files

  1. exploit-two-time-pad.py - the main script
  2. ciphers.txt - txt file to enter ciphertexts one per line
  3. target.txt - target ciphertext to decrypt
  4. decrypt.txt - output file for the decrypted message.

Approach

The key is guessed using:

  1. Given two ciphertexts c1 and c2 for plaintext messages m1 and m2 respectively, c1 xor c2 gives m1 xor m2.
  2. For any character c in [a-zA-Z], c xor (space) reverses the case of the character.

About

Simple exploit for multi-use keys in stream ciphers like One Time Pad

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages