Added the szyfrowanie-krzywej-tmp.rb
This commit is contained in:
parent
dcd6ab195d
commit
45ae34eb5c
BIN
6/lab3_kryptoalgo.pdf
Normal file
BIN
6/lab3_kryptoalgo.pdf
Normal file
Binary file not shown.
BIN
7-cw/7.pdf
Normal file
BIN
7-cw/7.pdf
Normal file
Binary file not shown.
31
7-cw/szyfrowanie-krzywe.rb
Normal file
31
7-cw/szyfrowanie-krzywe.rb
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/ruby
|
||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
###################################
|
||||||
|
#
|
||||||
|
# Marcin Woźniak
|
||||||
|
# s434812
|
||||||
|
#
|
||||||
|
###################################
|
||||||
|
|
||||||
|
load '../module.rb'
|
||||||
|
load '../6/krzywa.rb'
|
||||||
|
|
||||||
|
def genKeysElGamalKrzywaEliptyczna
|
||||||
|
p = generate(300)
|
||||||
|
|
||||||
|
if primalityTest(p)
|
||||||
|
|
||||||
|
krzywa = generatorKrzywej(p)
|
||||||
|
a = krzywa[0].to_i
|
||||||
|
b = krzywa[1].to_i
|
||||||
|
|
||||||
|
while
|
||||||
|
|
||||||
|
# if x < ord = #E(Fp)
|
||||||
|
# x = SecureRandom.random_number(1..ord)
|
||||||
|
# end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user