Inspect for keys

master
E. Almqvist 3 years ago
parent fdaf12ec58
commit 683cb13779
  1. 4
      ma5/rsa/rsa.rb
  2. 1
      ma5/rsa/test.rb

@ -35,6 +35,10 @@ module RSA
@d = RSA.modinv(@e, @phi)
end
def inspect
"n=#{@n}"
end
def pubkey
return @e, @n
end

@ -36,6 +36,7 @@ puts "p1=#{p1}, p2=#{p2}"
puts
key = RSA::Key.new(p1, p2)
puts key.inspect
print "Message to be encrypted: "
msg = gets.chomp

Loading…
Cancel
Save