I am a newbi, and not sure if this is the place to ask for help.
I want a encrypt/decrypt function, fn encrypt(a: &str) -> Stringfn decrypt(a: &str) -> String
I want to use des, or aes ( not even sure what they mean), but it seems really difficult to create such functions, I asked AI, googled libraries, but they all seems supriingly complicated, and I can not make the compiler happy, simply because some type does not exist in some lib even AI said so.
Any help with a complete example of encryption?
Thanks,
Beware that functions exactly like the ones you specified will most likely do only encoding, which is not encryption, and isn't ensuring security/privacy of the data.
Encryption always requires some form of secret or private key. If you're not providing a key/secret, you're not encrypting.
Encrypted data usually needs additional information about parameters used when encrypting, as well as a digest/hash/mac/checksum that ensures the encrypted data hasn't been manipulated. This is why you end up with more complex APIs and output that is more than just a string.