Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
algorand
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nilak
algorand
Commits
aa110aca
Commit
aa110aca
authored
Apr 09, 2019
by
THAKARE AKSHAY HARIBHAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added pseudo-randgen and keypair generator
parent
e7740e78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
Network.py
Network.py
+2
-0
Utility.py
Utility.py
+27
-0
No files found.
Network.py
View file @
aa110aca
...
...
@@ -7,6 +7,8 @@ import logging
logger
=
logging
.
getLogger
(
__name__
)
class
Network
():
def
__init__
(
self
):
self
.
nodes
=
{}
#{1 : Node(1),2:Node(2)}
...
...
Utility.py
0 → 100644
View file @
aa110aca
from
ecdsa
import
SigningKey
# import secrets
import
random
def
pseudoRandomGenerator
(
seed
)
:
random
.
seed
(
seed
)
return
random
.
getrandbits
(
256
)
def
genratePublicPrivateKey
():
sk
=
SigningKey
.
generate
()
# uses NIST192p
vk
=
sk
.
get_verifying_key
()
signature
=
sk
.
sign
(
b
"message"
)
assert
vk
.
verify
(
signature
,
b
"message"
)
return
(
sk
,
vk
)
pass
if
__name__
==
'__main__'
:
# keypair = genratePublicPrivateKey()
# keypair2 = genratePublicPrivateKey()
# print(keypair)
# print(keypair2)
print
(
pseudoRandomGenerator
(
"abc"
))
print
(
pseudoRandomGenerator
(
"abc"
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment