NCrypter - mathix420/NimingCypher GitHub Wiki
Encrypt or decrypt data 🔐
How to initialize NimingCypher
from NimingCypher import NCrypter
crypter = NCrypter("https://YourKey.com")
if crypter.result == False:
print("Error when getting the key!")
How to encrypt text
encr_text = crypter.crypt_text("Your clear text")
print(encr_text)
How to decrypt text
decr_text = crypter.decrypt_text(encr_text)
print(decr_text)
How to encrypt a file
clear_sum_sha256, encrypted_bytes = crypter.crypt_file("Path_of_the_file")
print(clear_sum_sha256)
#at this point you can send the encrypted bytes instead of save them
foo = open("Encrypted_file_path","wb+")
foo.write(encrypted_bytes)
foo.close()
How to decrypt a file
decrypted_sum_sha256 = crypter.decrypt_file(encrypted_bytes, "Path_of_decrypted_file", True)
#True mean the file will be open at the end of decryption (optional False by default)
print(decrypted_sum_sha256) #normally the same as clear file
How to change key
result = crypter.setkey("https://NewKey.com")
if result == False:
print("Error when getting the key!")