You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
cipher in order to ciphersource and store the result indestination.
uncipher in order to unciphersource and store the result indestination.
attack in order to make frequential analysis onsource and store the result indestination.
Cipher type:
-vigenere in order to useVigenère ciphering.
-caesar in order to useCaesar ciphering.
Source: the path to the file to read from.
Destination: the path to the file that will store the result of the treatment.
Key: is the key. It is a character string, each character corresponding to its position in the alphabet. A key of size 1 should be used with Caesar cipher. Also, when attacking the key optional (when given it is not treated).
Examples
Ciphering example
In order to cipherinitial_message, use the following command:
./sec cipher -vigenere initial_message ciphered_message example
The ciphered content is stored in theciphered_message file.
Note: ciphering in Vigenère or in Caesar will be treated the same way.
Unciphering example
In order to uncipherciphered_message, use the following command:
./sec uncipher -vigenere ciphered_message unciphered_message example
The uciphered content is stored in theunciphered_message file.
Note: unciphering Vigenère or Caesar will be treated the same way.
Vigenère frequential analysis example
In order to breakciphered_message, use the following command:
The uciphered content is stored in thebroken_message file.
Known bugs
This frequential analysis implementation is based on the fact that the letter 'e' is the most frequent in English. Trying to analyse and uncipher (without the key) a text that does not respect this assumption will result in gibberish.
Also, during the frequential analysis, if the key length divides the text in subtexts with a different most frequent character than 'e', the analysis won't be abble to find the right key.