streamlined the layout, don't need a package

This commit is contained in:
Joshua Flores 2025-04-26 08:47:35 -04:00
parent 037472fc07
commit 5f28587c15
No known key found for this signature in database
GPG key ID: CE41E342DBBBB9B7
9 changed files with 11 additions and 73 deletions

14
cryptlib.py Normal file
View file

@ -0,0 +1,14 @@
import base64
# this function takes a string representing hex, converts to bytes, and re-encodes to base64
def hex_to_base64(hex_string):
byte_array = bytearray.fromhex(hex_string)
base64_value = base64.b64encode(byte_array)
return base64_value
# this function takes two hex strings, converts them to bytes, and xor's them
def byte_xor(bs1, bs2):
byte_array1 = int(bs1,16)
byte_array2 = int(bs2,16)
return byte_array1 ^ byte_array2