Git Product home page Git Product logo

lock_files's People

Contributors

izxle avatar jlinoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lock_files's Issues

use the bufferSize encrypt big file

Will there be a problem with this?
I mainly think about encrypting large files. I think scripts should have this function, which is perfect.

bufferSize = 64 * 1024000
def read_file(opts, path, stats):
'''
Read the file contents.
'''
try:
while True:
with open(path, 'rb') as ifp:
data = ifp.read(bufferSize)
stat_inc(stats, 'read', len(data))
return data
except IOError as exc:
get_err_fct(opts)('failed to read file "{}": {}'.format(path, exc))
return None

Decrypting with wrong password

Hello, I installed this repo and I was checking it out to use it within a project. However, it turns out after I encrypt something and the time for decryption comes, the decryption never fails. No matter what password you choose it always decrypts. Please try this out and inform me if I might be doing something wrong or if your code needs editing.

i try encrypt a vhdx file,OverflowError

the file size is 5.16GB,VERSION = '1.1.3'
C:\Users\vinso\Desktop\lock_files>lock_files.py -P vinson -vv --lock D:\360Downloads\Software
INFO:544 lock "D:\360Downloads\Software\vinson.vhdx" --> "D:\360Downloads\Software\vinson.vhdx.locked"
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\vinso\Desktop\lock_files\lock_files.py", line 455, in thread_process_file
process_file(opts, password, entry, stats)
File "C:\Users\vinso\Desktop\lock_files\lock_files.py", line 588, in process_file
lock_file(opts, password, path, stats)
File "C:\Users\vinso\Desktop\lock_files\lock_files.py", line 548, in lock_file
data = AESCipher(openssl=opts.openssl).encrypt(password, content)
File "C:\Users\vinso\Desktop\lock_files\lock_files.py", line 187, in encrypt
ciphertext_binary = encryptor.update(padded_plaintext) + encryptor.finalize()
File "C:\Python27\lib\site-packages\cryptography\hazmat\primitives\ciphers\base.py", line 149, in update
return self._ctx.update(data)
File "C:\Python27\lib\site-packages\cryptography\hazmat\backends\openssl\ciphers.py", line 124, in update
n = self.update_into(data, buf)
File "C:\Python27\lib\site-packages\cryptography\hazmat\backends\openssl\ciphers.py", line 140, in update_into
self._backend._ffi.from_buffer(data), len(data)
OverflowError: integer 5540675600 does not fit '32-bit int'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.