Server.subroutes.crypto
Module Contents
Functions
|
Encrypts a string with a key. |
|
Decrypts a string with a key. |
|
Generates a key. |
|
Hashes a string. |
Attributes
- Server.subroutes.crypto.router
- Server.subroutes.crypto.encrypt(text: str, key: str | None = None) Dict[str, str]
Encrypts a string with a key.
- Parameters:
text – The string to encrypt
key – [Optional] The key to encrypt with. If not provided, a new key will be generated.
- Returns:
A dictionary with the encrypted string and the key
- Server.subroutes.crypto.decrypt(text: str, key: str) dict | str
Decrypts a string with a key.
- Parameters:
text – The string to decrypt
key – The key to decrypt with
- Returns:
A dictionary with the decrypted string