相关疑难解决方法(0)

PyCrypto 可以检查文件是否已经 AES 加密?

  from Crypto.Cipher import AES

    def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024):
        """ Encrypts a file using AES (CBC mode) with the
            given key.

            key:
                The encryption key - a string that must be
                either 16, 24 or 32 bytes long. Longer keys
                are more secure.

            in_filename:
                Name of the input file

            out_filename:
                If None, '<in_filename>.enc' will be used.

            chunksize:
                Sets the size of the chunk which the function
                uses to read and encrypt the file. Larger chunk
                sizes can be faster for …
Run Code Online (Sandbox Code Playgroud)

python encryption ipython pycrypto python-2.7

5
推荐指数
1
解决办法
4514
查看次数

标签 统计

encryption ×1

ipython ×1

pycrypto ×1

python ×1

python-2.7 ×1