Giter Club home page Giter Club logo

Comments (3)

highend avatar highend commented on May 23, 2024 1

Hi,

It's a design decision and it's yours :) I guess any file that only has a few bytes will be enlarged to at least 16 KiB with -f|--obfuscate so it doesn't matter if it does it for 0-byte files as well. I wouldn't want to get notifications on the command line when something like this happens, at least it would be nice if this could be suppressed. Take your time to fix this and have a nice holiday!

from kryptor.

samuel-lucas6 avatar samuel-lucas6 commented on May 23, 2024

Hi @highend,

Many thanks for the report. It unfortunately looks like I never tested encrypting/decrypting 0 byte files properly.

I just tried encrypting and decrypting an empty text file, and it did decrypt to a 0 byte file, but I also got that error message, and the .kryptor file was not deleted because of the exception. I can already see the problematic line in the code. The program tries to set the length of the file to less than 0 because there's no padding to remove.

If you use -f|--obfuscate, then there's no error message because there's a chunk after the headers. However, I should warn you that doing this will cause the 0 byte files to increase in size to 16 KiB once encrypted because Kryptor is designed to hide the exact length of the file. I have mixed feelings about whether that's the right approach to take since it increases storage requirements and other programs don't do that. Please let me know what you think. It would require a breaking change to tweak though.

Anyway, I'll get this fixed for the next release. I'm afraid I'm going on holiday, so it'll take some time. There are also a few other minor things I'd like to add for v3.0.4 that I haven't managed to do yet because I've been working on some other projects.

from kryptor.

samuel-lucas6 avatar samuel-lucas6 commented on May 23, 2024

Thanks! I think that's best for now at least. I'll perhaps remove the chunking for small files in v4. We'll see.

from kryptor.

Related Issues (20)

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.