class EnigmaEncrypto::RotationNumGen

Attributes

key[RW]
offset[RW]
showkey[RW]
today_date[RW]

Public Class Methods

new() click to toggle source
# File lib/enigma_encrypto/rotation_num_gen.rb, line 10
def initialize
  @key_without_offset = KeyGen.new
  @key = @key_without_offset.initial_rotation_keys
  @showkey = @key_without_offset.display_key
  @offsetgen = DateOffsetGen.new
  @offset = @offsetgen.get_offset
  @today_date = @offsetgen.todays_date
end

Public Instance Methods

crack_num_arr(key, date) click to toggle source
# File lib/enigma_encrypto/rotation_num_gen.rb, line 33
def crack_num_arr(key, date)
  @key = key
  @offset = date
  rotation_num_array
end
reverse_num_array(key, date) click to toggle source
# File lib/enigma_encrypto/rotation_num_gen.rb, line 27
def reverse_num_array(key, date)
  @offset = @offsetgen.get_decrypter_offset(date)
  @key = @key_without_offset.initial_decryption_keys(key)
  rotation_num_array
end
rotation_num_array() click to toggle source
# File lib/enigma_encrypto/rotation_num_gen.rb, line 19
def rotation_num_array
  rotation_num = []
  4.times do |index|
    rotation_num << @key[index] + @offset[index]
  end
  rotation_num
end