hmacrypt/string_encryptor.py
2024-02-06 16:27:04 +01:00

16 lines
382 B
Python

import src.hmacrypt as hmacrypt
import sys
# Getting and requiring exactly 1 argument
if len(sys.argv) != 2:
print("Usage: python3 string_encryptor.py <string to encrypt>")
sys.exit(1)
stringToEncrypt = sys.argv[1]
encrypted = hmacrypt.self_encrypt(stringToEncrypt)
with open("encrypted.txt", "wb+") as encryptedFile:
encryptedFile.write(encrypted)
print(encrypted)