kasiski: Kasiski attack

Description Usage Arguments Examples

View source: R/classic.R

Description

Vigenere cipher can be decrypted without the key. First find the key length. Then divide ciphertext into as many sub-ciphertexts as the key length.

Usage

1
kasiski(msg, freq, lenkey = 0)

Arguments

msg

Ciphertext.

freq

Letter's frequency in the message's language.

lenkey

Key length can be provided to avoid compute it.

Examples

1
2
3
4
5
crypto <- vigenere(msg_en,"abc")
crypto
info <- kasiski(crypto,freqs$en)
info
vigenere(crypto,info$key,decrypt=TRUE)

JorgeRiescoDavila/somecrypto documentation built on Jan. 10, 2022, 1:49 a.m.