Created
May 22, 2014 04:35
-
-
Save horitaku1124/d23c3f09a930dfcb4ce8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = [7,13,17,24] | |
primes = [3,11] | |
pubkey1 = primes[0] * primes[1] | |
pubkey2 = (primes[0] - 1) * (primes[1] - 1) | |
key2 = 3 | |
encd = data.map do |e|( e ** key2 )% pubkey1 end | |
p encd | |
secret = (pubkey2 + 1) / key2 | |
data2 = encd.map do |e|( e ** secret ) % pubkey1 end | |
p data2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment