pub fn encrypt(
message: &str,
password: &str,
) -> Result<String, ValidationErrors>Expand description
Encrypts a message using a password and returns a Base64-encoded payload.
Internally runs the message through three stages:
- SGA encoding — substitutes each letter with its Standard Galactic Alphabet symbol.
- AES-256-GCM — encrypts the encoded text. A random salt and nonce are generated on every call, so two calls with identical inputs will always produce different outputs.
- Base64 — packs
salt + nonce + ciphertextinto a single portable string.
§Errors
Returns an error if encryption fails.
§Example
let ciphertext = ender_eye::encrypt("hello world", "my-password").unwrap();