first two challenges solved
This commit is contained in:
parent
988d229bce
commit
037472fc07
8 changed files with 77 additions and 12 deletions
12
tests/01.py
12
tests/01.py
|
@ -1,10 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from cryptopals import helper
|
||||
from cryptopals import cryptopals
|
||||
import os, sys
|
||||
|
||||
module_dir = os.path.relpath('../src/cryptopals')
|
||||
sys.path.insert(0, module_dir)
|
||||
|
||||
import helper, cryptlib
|
||||
|
||||
def main():
|
||||
pass
|
||||
hex_string = helper.read_file("../data/01.txt")
|
||||
solution = cryptlib.hex_to_base64(hex_string)
|
||||
print(solution.decode())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
17
tests/02.py
Normal file
17
tests/02.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os, sys
|
||||
|
||||
module_dir = os.path.relpath('../src/cryptopals')
|
||||
sys.path.insert(0, module_dir)
|
||||
|
||||
import helper, cryptlib
|
||||
|
||||
def main():
|
||||
content = helper.read_file("../data/02.txt")
|
||||
hexstring_list = content.splitlines()
|
||||
solution = cryptlib.byte_xor(hexstring_list[0], hexstring_list[1])
|
||||
print(hex(solution)[2:])
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -1,5 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os, sys
|
||||
|
||||
module_dir = os.path.relpath('../src/cryptopals')
|
||||
sys.path.insert(0, module_dir)
|
||||
|
||||
import helper, cryptlib
|
||||
|
||||
def main():
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue