Vernam Cipher in Swift

Unbreakable encryption is possible. Welcome to One-time Pad or what also referred to as “the perfect cipher”. To be honest, it is comforting to know that it is possible to encrypt text conversations to the point where it is practically impossible to decrypt without having the correct key. While the previous two ciphers mentioned earlier (Caesar Cipher and Vigenere Cipher) provide a way to scramble text into “gibberish”, both can be easily decrypted using pattern matching without needing the original key.

Unlike previous crypto algorithms, Vernam uses random key composed of random numbers to encrypt text. It is a very simple, yet powerful algorithm as you will see shortly.

Continue reading “Vernam Cipher in Swift”

Vernam Cipher in Swift