Encrypt string in Python

后端 未结 6 978
孤街浪徒
孤街浪徒 2021-01-06 11:29

I need to encrypt a small string in Python. Is it possible to use a secret key to encrypt the string? Is there a good way to do this and achieve a reasonable encryption leve

6条回答
  •  旧时难觅i
    2021-01-06 12:15

    KeyCzar has a nice interface and should meet your requirements. From the home page:

    Keyczar is an open source cryptographic toolkit designed to make it easier and safer for devlopers to use cryptography in their applications. Keyczar supports authentication and encryption with both symmetric and asymmetric keys

    crypter = Crypter.Read("/path/to/your/keys")
    ciphertext = crypter.Encrypt("Secret message")
    

提交回复
热议问题