streamlined the layout, don't need a package
This commit is contained in:
parent
037472fc07
commit
5f28587c15
9 changed files with 11 additions and 73 deletions
10
01.py
Normal file
10
01.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import helper, cryptlib
|
||||||
|
|
||||||
|
def main():
|
||||||
|
hex_string = helper.read_file("data/01.txt")
|
||||||
|
solution = cryptlib.hex_to_base64(hex_string)
|
||||||
|
print(solution.decode())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
|
@ -1,14 +1,7 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import os, sys
|
|
||||||
|
|
||||||
module_dir = os.path.relpath('../src/cryptopals')
|
|
||||||
sys.path.insert(0, module_dir)
|
|
||||||
|
|
||||||
import helper, cryptlib
|
import helper, cryptlib
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
content = helper.read_file("../data/02.txt")
|
content = helper.read_file("data/02.txt")
|
||||||
hexstring_list = content.splitlines()
|
hexstring_list = content.splitlines()
|
||||||
solution = cryptlib.byte_xor(hexstring_list[0], hexstring_list[1])
|
solution = cryptlib.byte_xor(hexstring_list[0], hexstring_list[1])
|
||||||
print(hex(solution)[2:])
|
print(hex(solution)[2:])
|
|
@ -1,19 +0,0 @@
|
||||||
[project]
|
|
||||||
name = "cryptopals"
|
|
||||||
version = "0.1"
|
|
||||||
authors = [
|
|
||||||
{ name="Joshua Flores", email="josh@heavyguys.net"},
|
|
||||||
]
|
|
||||||
description = "A place to hold solutions for the Cryptopals Challenges"
|
|
||||||
readme = "README.md"
|
|
||||||
requires-python = ">=3.9"
|
|
||||||
classifiers = [
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"Operating System :: OS Independent",
|
|
||||||
]
|
|
||||||
license = "MIT"
|
|
||||||
license-files = ["LICEN[CS]E"]
|
|
||||||
|
|
||||||
[project.urls]
|
|
||||||
Homepage = "https://git.heavyguys.net/Josh/cryptopals"
|
|
||||||
|
|
24
setup.cfg
24
setup.cfg
|
@ -1,24 +0,0 @@
|
||||||
[metadata]
|
|
||||||
name = cryptopals
|
|
||||||
version = 0.1
|
|
||||||
author = Joshua Flores
|
|
||||||
author_email = josh@heavyguys.net
|
|
||||||
description = Cryptopals Solutions
|
|
||||||
long_description = file: README.md, LICENSE.txt
|
|
||||||
long_description_content_type = text/markdown
|
|
||||||
url = https://git.heavyguys.net/Josh/cryptopals
|
|
||||||
project_urls =
|
|
||||||
repository = https://git.heavyguys.net/Josh/cryptopals.git
|
|
||||||
classifiers =
|
|
||||||
Programming Language :: Python :: 3
|
|
||||||
License :: OSI Approved :: MIT License
|
|
||||||
Operating System :: OS Independent
|
|
||||||
|
|
||||||
[options]
|
|
||||||
package_dir =
|
|
||||||
= src
|
|
||||||
packages = find:
|
|
||||||
python_requires = >=3.9
|
|
||||||
|
|
||||||
[options.packages.find]
|
|
||||||
where = src
|
|
|
@ -1,10 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, sys
|
|
||||||
|
|
||||||
module_dir = os.path.relpath('../src/cryptopals')
|
|
||||||
sys.path.insert(0, module_dir)
|
|
||||||
|
|
||||||
import helper, cryptlib
|
import helper, cryptlib
|
||||||
|
|
||||||
def main():
|
def main():
|
17
tests/01.py
17
tests/01.py
|
@ -1,17 +0,0 @@
|
||||||
#!/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():
|
|
||||||
hex_string = helper.read_file("../data/01.txt")
|
|
||||||
solution = cryptlib.hex_to_base64(hex_string)
|
|
||||||
print(solution.decode())
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
Loading…
Add table
Add a link
Reference in a new issue