Giter Club home page Giter Club logo

kryptor's People

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  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  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  avatar

Watchers

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

kryptor's Issues

πŸ› Bug: System.OverflowException converting the FileStream length to an int

Describe the bug
System.OverflowException converting a large FileStream length to an int in GetBufferSize().

To Reproduce
Steps to reproduce the behavior:

  1. Try to encrypt a 3 GB file.

Expected behaviour
File encryption should occur as expected without an exception.

Error log
Unhandled exception. System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ThrowInt32OverflowException()
at System.Convert.ToInt32(Int64 value)
at KryptorCLI.FileHandling.GetBufferSize(Int64 fileStreamLength)
at KryptorCLI.Encryption.EncryptFile(String filePath, String encryptedFilePath, Byte[] salt, Byte[] nonce, ValueTuple`2 keys)
at KryptorCLI.Encryption.InitializeEncryption(String filePath, Byte[] passwordBytes)
at KryptorCLI.FileEncryption.CallEncryption(Boolean encryption, String filePath, Byte[] passwordBytes)
at KryptorCLI.FileEncryption.GetFilePaths(Boolean encryption, String[] filePaths, Byte[] passwordBytes)
at KryptorCLI.FileEncryption.StartEncryption(Boolean encryption, String[] filePaths, Byte[] passwordBytes, String keyfilePath)
at KryptorCLI.CommandLine.CallEncryption(Boolean encryption, Char[] password, String keyfilePath, String[] filePaths)
at KryptorCLI.CommandLine.ValidateFileEncryptionInput(Boolean encryption, Char[] password, String keyfilePath, String[] filePaths)
at KryptorCLI.Program.OnExecute()
--- End of stack trace from previous location where exception was thrown ---
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.Invoke(MethodInfo method, Object instance, Object[] arguments)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](IConsole console, String[] args)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](String[] args)
at KryptorCLI.Program.Main(String[] args)
Aborted (core dumped)

Desktop (please complete the following information):

  • OS: Linux
  • Version: CLI v2.2.0 Beta

πŸ› Bug: Cannot decrypt folder with anonymous rename disabled

Description

Reported by a non-GitHub user via email:

I have found a bug where Kryptor (version 2.2.2) cannot decrypt a folder it encrypted and I see no way in which the folder can be decrypted (the kryptor files are deleted). Fortunately, I was using a test folder and so lost no data. The bug centres around the Anonymous Rename setting.

Steps to Reproduce

  1. With Anonymous Rename set to "Enabled" (the default), encrypt a folder by dragging it on to the Kryptor window, entering a password and selecting "Encrypt".
  2. Select File, Settings and set Anonymous Rename to "Disabled" then close the settings window.
  3. Drag the folder encrypted in 1 on to the Kryptor window, enter the password and select "Decrypt". The folder (and its files) remain encrypted.

Expected Behaviour

The folder should be decrypted.

Screenshots

N/A

Platform Info

  • OS: Unknown
  • Version: GUI v2.2.2 Beta

πŸ› Bug: Test Parameters button crashes Kryptor on Mono

Describe the bug
Sometimes pressing the 'Test Parameters' button in settings crashes Kryptor on Mono.

To Reproduce
Steps to reproduce the behavior:

  1. Go to File => Settings.
  2. Click on 'Test Parameters'.
  3. The message box is black and the program crashes.

Expected behaviour
A message box should display normally like on Windows. The program should not be crashing.

Desktop (please complete the following information):

  • OS: Linux
  • Version: 1.0.0.0

πŸ› Bug: Some warmup is needed before launching 'Test Parameters' or Argon2 benchmark

Describe the bug
As power management is usual on Laptops/PCs, CPU frequency is usually low until some more work is being done.

To Reproduce
On my Linux test with version 2.1.0 beta, here are the 1st few lines from benchmark.txt:

50 MiB = 155 ms
55 MiB = 72 ms
60 MiB = 76 ms
65 MiB = 80 ms
70 MiB = 83 ms
75 MiB = 89 ms
80 MiB = 97 ms
85 MiB = 101 ms
90 MiB = 107 ms
95 MiB = 113 ms
100 MiB = 121 ms
105 MiB = 125 ms
110 MiB = 131 ms
115 MiB = 137 ms
120 MiB = 146 ms
125 MiB = 151 ms
130 MiB = 156 ms
135 MiB = 162 ms
140 MiB = 167 ms

Also later on if I run "Test Parameteres" it always gives very bad results compared to initial benchmarks unless I'm running some CPU eating process to warm up CPU - like yes >/dev/null - before running the test.

Expected behaviour
Should warm-up, like running the 1st test 2 times, discard results, then start counting.

Desktop (please complete the following information):

  • OS: Linux
  • Version: 2.1.0 beta

Thanks for the app 🌹

πŸ› Bug: Incorrect decrypted file name for duplicated files when in the same location.

Description

Situation : I have a file called Document.txt, i encrypt this file and have the new file named Document.txt.kryptor, then I encrypt the same Document.txt file and get another encrypted file called Document.txt (2).kryptor. When trying to decrypt the second file Document.txt (2).kryptor everything works except the new decrypted file is called Document.txt (2). this file won't open unless you rename it (remove brackets) to Document.txt.

This situation only happens when there is already another file having the same name.

Platform Info

  • OS: Windows
  • Version: 3.0.3

✨ Feedback: Better UX: Error: This file/folder doesn't exist.

Description

After using the "-e -p" options command, the program first asks you for the password and then informs you that you typed the wrong file name. It would be more logical to reverse the check.

X:\Some\Windows\Path\kryptor-windows> ./kryptor -e -p MyMissTypoFile.txt
Enter a password (leave empty for a random passphrase):
Retype password:

MyMissTypoFile.txt - Error: This file/folder doesn't exist.

πŸ›Bug: cannot execute pre-built Linux binary; exec: Failed to execute process

Description

cannot execute the linux binary blob

Fish Log:
exec: Failed to execute process '/home/[profile redacted]/.nix-profile/bin/kryptor': The file exists and is executable. Check the interpreter or linker?
Bash Log:
bash: ./kryptor: cannot execute: required file not found

Steps to reproduce

  1. download Linux Pre-built binary
  2. chmod +x it
  3. try to run it
  4. get error log

Expected behaviour

it should run and tell me to use -h

Platform info

  • OS: [NixOS unstable]
  • Kryptor version: [4.0.1]

Corruption Verification

Description

This not so much a bug as it is me trying to figure out what went wrong in the decryption. I was decrypting my files so I could update from v3.0.4 to 4.0.1 when I found I wasn't able to decrypt about half the files. They just throw this error:

Deriving encryption key from password...
Decrypting filename.kryptor => filename...
filename.kryptor - Error: CryptographicException - Unable to decrypt the file.

I am using the same keyfile as it worked on the other files but there were a few that it wouldn't work with. I figure it's just bitrot or something. I had the files on a USB that was only accessed weekly running NTFS. Is there anything I can do to recover the files or at least make them decryptable (hex editor and screwing with the text maybe, idk)? I can remake the files if need be so there's no data loss, just wondering if there's anything I can do in order to not have to remake them.

I am on Windows 10, 21H2 (though I doubt this to be an OS issue, can try in Linux if necessary).

πŸ“‹ Feature: Support for macOS Catalina (10.15)

Is your feature request related to a problem? Please describe.
Unfortunately, Mono for Windows Forms and Wine are not supported on macOS Catalina because 32-bit application support has been removed in Catalina. This means you cannot currently run Kryptor on macOS 10.15.

Describe the feature you'd like
Support for macOS Catalina and greater support for Linux and macOS in general - e.g. no Mono requirement because Mono is large. As such, I am going to write a console version of Kryptor in .NET Core 3.1 that will be self-contained and completely portable. I can use most of the current Kryptor code, but handling user input will need to be sorted out. I am becoming increasingly busy with work, but I will try to get started on this.

File/Folder encrypting problem

I have a folder with some different filetypes inside and not all of them seem to be encrypting. Are there any file extensions that wont be encrypted by kryptor ?

πŸ’» Support: Incorrect password

Description

I tried decrypting a folder that I encrypted on another PC but I always get the "Incorrect password/keyfile or this file has been tampered with" for 2/13 files. I had only copy the encrypted folder to a USB and then the other PC and got this (there were 13 files and a total of 4GBs), also when I encrypted a big folder (20GBs) and sent it to the cloud to share it with people they (and me when I tried) got the same error. I guess is a bug or am I doing something wrong?? I am no IT guy just a privacy advocate so if possible explanation for dummies :D

πŸ“‹ Feature: Issues running Kryptor in Wine

Based on some very quick testing in Wine, it seems like most of the program works. Most of the previous issues have now been fixed (see the next comment).

Working:

  • Argon2 benchmark (only tested from settings)
  • File and folder selection
  • Creating and selecting keyfiles
  • Folder encryption/decryption
  • Anonymous folder and file rename
  • Password entropy estimation
  • Password generator
  • Password sharing
  • Shred files and folders
  • Opening links
  • Checking for updates
  • Editing settings
  • Memory encryption doesn't produce any errors
  • Backing up settings
  • Error logging

Fixed:

  • File selection
  • Creating and selecting keyfiles
  • Shred files

The exception for file selection (anything involving FileDialog) - System.ArgumentException: Value does not fall within the expected range - has now been fixed (see next comment).

Issues:

  • Some labels get cut off
  • Drag and drop for file selection
  • Copying to or clearing the clipboard

πŸ› Bug: Decrypting a folder - Zero length files aren't decrypted

Description

I've just wanted to try out kryptor so I've just encrypted a folder with some files in it. Quite a few of them do not have any content and aren't saved with a BOM (regardless of their extension, most are just text files) so they have a file size of 0 bytes.

Steps to Reproduce

kryptor.exe -e -o -y "D:\gf.public" "R:\tst\Temp"
All files are encrypted successfully, including the 0-bytes files

kryptor.exe -d -o -y "D:\gf.public" "R:\tst\Temp"

test.py.kryptor => test.py
y.jpg.kryptor: Non-negative number required. (Parameter 'value')
y.txt.kryptor: Non-negative number required. (Parameter 'value')
z.abc.kryptor: Non-negative number required. (Parameter 'value')
z.ahk.kryptor: Non-negative number required. (Parameter 'value')
z.bmp.kryptor: Non-negative number required. (Parameter 'value')
z.eml.kryptor => z.eml
etc.

The original test.py and z.eml are not 0-byte files, the others are

Expected Behaviour

Even 0-byte files should be decrypted.
Otherwise you have a lot of .kryptor files lying around and e.g. a lot of portable applications on Windows use a e.g. portable.dat file in their root folder that is empty and let them know (if it exists) that they should run in portable mode.
The current situation will break that behavior!

Platform Info

  • OS: Windows Server 2019
  • Version: v3.0.3

πŸ› Bug: Interactively created passphrase does not work.

Description

Interactively created passphrase does not work. Neither when it is pasted nor typed by hand.

Steps to reproduce

  1. Use kryptor -e -p -n [File Name] to encrypt.
  2. Press Enter to create auto passphrase.
  3. Use kryptor -d [File Name] command to decrypt.
  4. Type by hand or paste the automatically created passphrase when asked.

Expected behaviour

Successfully decrypt the file.

Screenshot

MJ01V6lHhy.mp4

Platform info

  • OS: Windows 11 21H2 (22000.739)
  • Kryptor version: 3.1.1.0

πŸ“‹ Feature: Speed up reading original file name for large files

Is your feature request related to a problem? Please describe.
I've been benchmarking file encryption for large files (2 GB) after making some file handling changes for the next release and noticed that most of the decryption time is due to File.ReadLines() being used to read the last line of the file to retrieve the original file name when the Anonymous Rename setting is enabled.

Describe the feature you'd like
In the next major release, I need to either find a faster method of reading this information, move the location of the original file name so that it's easier to access, or switch to a different method of storing the file name (e.g. how Cryptomator does it).

Cryptomator's method would probably be fastest as it requires no reading from the file at all, but I'd have to encrypt the file names and convert them to a safe format for the file system. The main limitations of this approach are that the user can't rename the files without losing the original file name and that handling long file names is problematic.

Why should this feature be implemented?
To speed up decryption of large and medium sized files.

πŸ“‹ Feature: Faster folder encryption

Is your feature request related to a problem? Please describe.
Kryptor currently takes quite a while to encrypt a large number of files (e.g. thousands) at a time because key derivation occurs for each file. This approach works well for fewer files, but it leads to a greater delay when encrypting lots of files - e.g. 250 ms per file = 250 seconds of key derivation for 1000 files.

Describe the feature you'd like
Investigate a way of encrypting folders in a similar way to Cryptomator. In other words, derive an encryption key and MAC key once using a longer delay (e.g. 1 second). Then either a) use these keys to encrypt all the files in the folder (quickest approach) or b) store these keys in a file inside the selected folder and use them to encrypt randomly generated keys per file (a more secure approach but slower). Cryptomator and AxCrypt use approach b), but it leads to slower decryption. However, there are potential issues that can arise from encrypting a large amount of data under the same keys, so approach b) is probably best.

Implementing this feature will make some of the code a bit more messy, and the Argon2 memory size/iterations settings will become a problem. It doesn't make sense to use a 250 ms delay to generate master keys when a 1 second delay can be used for increased security without it being very noticeable to the user. I'm not sure how this problem can be solved.

Why should this feature be implemented?
It will make encrypting folders/lots of files faster.

πŸ“‹ Feature: File names and tree structure

Is your feature request related to a problem? Please describe.
My problem is that I would like to be able to decrypt a single file from a folder but the names are random. Which is fine.

Describe the feature you'd like
But I would like to be able to have a file that has a different type that with the password would allow us to see the encrypted files and their original names and paths. And a function that would allow us in shred/encrypt only the files selected from this list.

Why should this feature be implemented?
I think I'm not the only one who would like to be able to encrypt his files and not have to decrypt all of them to open only one file but wants to keep the file name anonymous.

πŸ› Bug: Files with a certain length get truncated during decryption

Description

I received an email yesterday afternoon reporting an issue where files of a certain length get decrypted to an incorrect size.

Steps to reproduce

  1. Generate a binary file: dd if=/dev/zero of=data bs=1M count=1 iflag=fullblock.
  2. Encrypt the file: kryptor -e -p:test data.bin.
  3. Decrypt the file: kryptor -d -p:test data.bin.kryptor.
  4. Compare the SHA256 hash of the decrypted file with the original file.
  5. Compare the file size of the decrypted file with the original file.

Expected behaviour

The decrypted file should be the same size as the original file and have the same SHA256 hash.

Platform info

  • OS: Linux
  • Kryptor version: v3.1.0

✨ Feedback: 3.0b

Windows 7 user wants Kryptor to encrypt contents of C:\Test

kryptor.exe -e -p -f C:\Test

Enter a password (leave empty for a random passphrase):                           
Retype password:                                                                  
                                                                                  
Test: This directory is being backed up...                                       
.notable - Error: DirectoryNotFoundException - Unable to obfuscate directory name.  
ripyn4kjnqxz2arn24rhl0.txt => koe34pkxh4jusm2fqgd5kx.kryptor                                     
hello.md => 4dfgx2kiysv5uvifjaqtnu.kryptor      
...
.settings.json => 4hcmqm5un3j13fl5de3f5h.kryptor
Successfully encrypted: 300/300
  • Unclear (therefore disturbing) what has happened with a sub-folder .notable

  • There is no such ripyn4kjnqxz2arn24rhl0.txt in source folder (confusing)

  • Source folder has been renamed to Test-Copy (without user’s consent)

  • Destination (encrypted) folder (~4.5 MiB) is significantly larger than source folder (~500 KiB)


Bottom line: idea behind the project is great, but implementation is so-so thus far.

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.