thanks to the book by David Kahn Codebreakers , ancient cryptography, which is one of my hobbies, I try to implement in Ruby classes to process old ciphers, for example, the nihilist cipher and ADFGVX . One useful element for them is the Straddling checkboard . I have the following Ruby implementation and welcome any improvement.
class Key - the base class (if you need a virtual class). Key#condensed is a method that removes duplicate letters from a given word.
class SKey < Key attr_reader :full_key attr_reader :alpha, :ralpha def initialize(key) super(key) @alpha = Hash.new @ralpha = Hash.new @full_key = checkboard() gen_rings() end
Ruby / Python / Perl or pseudo code is right for me. Thanks for any idea.
source share