62a9fbd Replace Int with Integer
~shreyasminocha pushed to ~shreyasminocha/comp323 git
fa361b7 Implement knapsack and GGH
~shreyasminocha pushed to ~shreyasminocha/comp323 git
Disclaimer: Something something educational purposes only. Don't use these for anything serious lol.
echo 'Foo' | ./caesar 5
echo 'Foo' | ./caesar 5 | ./caesar -5
./caesar 13 < caesar.hs
echo 'Foo' | ./atbash
echo 'Foo' | ./atbash | ./atbash
./atbash < atbash.hs
echo 'Yellow' | ./vigenere 'dog'
./vigenere 'foo' < vigenere.hs
echo 'meet me at noon' | ./playfair 'abcdefghiklmnopqrstuvwxyz'
Where abcdefghiklmnopqrstuvwxyz
corresponds to the key:
abcde
fghik
lmnop
qrstu
vwxyz
Caveats:
echo 'theautokeycipheriscool' | ./autokey 'random'
Caveats:
egcd 10 15 -- (5,-1,1)
inverse 2035800 103 -- 810367
baseSolution 7 1 5 -- 3
solutions 98 60 34 -- [45,94]
crt [(2, 3), (3, 5), (2, 7)] -- 23
(p, q) = (1301, 1567)
(n, e) = (p * q, 103)
m = 892383
c = rsaEncrypt (n, e) m
m' = rsaDecrypt (n, inverse ((p - 1) * (q - 1)) e) c
m == m' -- True
(p, g) = (941, 627)
a = 347
a' = dhPersonalPublic (p, g) a
b = 781
b' = dhPersonalPublic (p, g) b
dhSharedSecret (p, g) a b' == dhSharedSecret (p, g) b a' -- True
pohligHellman 746497 10 243278 -- 223755
powMod 746497 10 223755 -- 243278
python shanks.py 650 2213 3571 # 319
isWitness 561 2 -- True
factorize 53357 -- (233,229)
factorizeWithK 1226987 3 36 -- (653,1879)
p - 1
methodfactorize 220459 2 -- 449
isSmooth 10 84 -- True
isPowerSmooth 10 84 -- True
quadraticSieve 493 11 [23..38] -- [(23,36),(25,132)]
ecdlpBruteforce (73, (8, 7)) (32, 53) (39, 17) -- 11
scalePoint (3623, (14, 19)) (6, 730) 947 -- (3492,60)
pc = (3851, (324, 1287))
p = (920, 303)
ecdhPersonalPublic pc p 1194 -- (2067,2178)
ecdhPersonalPublic pc p 1759 -- (3684,3125)
ecdhSharedSecret pc 1194 (3684, 3125) -- (3347,1242)
ecdhSharedSecret pc 1759 (2067, 2178) -- (3347,1242)
pow 2 10 -- 1024
powMod 43 2 10 -- 35
See LICENSE
.
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement.