diff --git a/ma5/rsa/rsa.rb b/ma5/rsa/rsa.rb index 46dcc8b..04136d1 100644 --- a/ma5/rsa/rsa.rb +++ b/ma5/rsa/rsa.rb @@ -35,6 +35,10 @@ module RSA @d = RSA.modinv(@e, @phi) end + def inspect + "n=#{@n}" + end + def pubkey return @e, @n end diff --git a/ma5/rsa/test.rb b/ma5/rsa/test.rb index 57700bd..ba4b8e4 100755 --- a/ma5/rsa/test.rb +++ b/ma5/rsa/test.rb @@ -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