Skip to content
/ JCrypt Public

This is a simple CLI text/file encrypter made in Java that supports XOR and AES-256.

License

Notifications You must be signed in to change notification settings

Slyvred/JCrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JCrypt

This is a simple CLI text/file encrypter made in Java that supports XOR and AES-256 (with salt).

Compatibility

It was written in Java using the jdk-21 so any machine with jdk-21 (or later) installed should be able to run it fine. You can also recompile it using an older version of the sdk such as jdk-17

Usage

foo@bar:~$ java -jar JCrypt.jar

<====== JCrypt - By Slyvred ======>
XOR and AES-256 encryption tool

1. Xor text
2. Xor file
3. Encrypt file (AES-256)
4. Decrypt file (AES-256)
5. Encrypt folder (AES-256)
6. Decrypt folder (AES-256)
7. Exit

Select an option: 

How does it work ?

AES Encryption

  • We generate an AES-256 key with the password submitted by the user and a randomly generated 16 bytes salt
  • We store the salt inside of the encrypted data at a position calculated by adding the length (in bytes) of the encrypted data and the salt length and dividing that by the length of the password.

AES Decryption

  • We calculate the AES-256 key with the password submitted by the user and the salt stored in the file
  • We recover the salt position in the file by dividing the length of the file (in bytes) by the length of the password

Performance

According to my tests we can encrypt and decrypt at ~200MB/sec for a single file and ~10MB/sec for a folder with several thousands of small files. That translates to about 380 files/sec.

Disclaimer

I made this project as a way to overcome boredom and to get familiar with Java. I am in no way, shape, or form a cryptography expert, so don't use this tool to protect sensitive information as it may be vulnerable and you may also lose your files!

Todo

  • Add salt support
  • Store salt and make it random
  • Store salt in the encrypted file
  • Make salt position "random" in the file
  • Add ECC ?