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
14
cryptlib.py
Normal file
14
cryptlib.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue