Coder Social home page Coder Social logo

masterflomaster1 / simplejavacrypter Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 13.0 23.25 MB

🔐 150+ Algorithms, Reactive GUI, and More: Text & File Encryption, Hashing, MAC, Key Generation, and Password Strength Evaluation. JCA, JCE with Bouncy Castle

License: Apache License 2.0

Java 94.35% CSS 0.01% SCSS 5.63%
java gui encryption javafx aes cipher md5 hash enigma hmac pbkdf2 password security chacha20 rc4 aes-256 salsa20 sha-256 mvvm reactive

simplejavacrypter's Introduction

JFXCrypto

build GitHub License GitHub Release Codacy Badge

Description

JFXCrypto is a flexible cryptographic tool designed to handle a wide range of encryption tasks. Featuring modern GUI, it supports over 150 encryption algorithms, spanning from ancient Greek ciphers to modern algorithms adopted by the US military and NSA.

Features

  • Utilize hundreds of available encryption algorithms through the Bouncy Castle library. See full list below.
  • Rich toolkit for encrypting text or files with support for variable key lengths, modes (ECB, CBC, CFB, OFB), various paddings (PKCS5Padding, PKCS7Padding, ISO10126Padding), and integration of salts and IVs for enhanced security.
  • Supports importing and exporting keys to PEM files using X509 and PKCS8 standards.
  • Generate hashes for text and files, and utilize HMAC (Hash-based Message Authentication Code) for data integrity verification.
  • Includes a collection of classic ciphers and ciphers from World Wars (See full list below)
  • Modern graphical interface powered by atlantafx library with support for multiple themes, animations, and icons, enhanced with an MVVM architecture.
  • Asynchronous operations, leveraging NIO 2 for efficient file handling and processing.
  • Specialized password generation tool based on PBKDF2 for modern and secure password hashing.
  • Password complexity and strength analysis using the zxcvbn4j library.
  • Utilizes the Have I Been Pwned API with k-anonymity model to check if the password has been exposed in data breaches.

Usage

  1. Download the latest release JAR file
  2. java --module-path path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxml -jar jfxcrypto-<version>.jar
    

The build requires JDK 17 or later.

MVVM Architecture

MVVM Diagram

The MVVM (Model-View-ViewModel) architecture separates the user interface (View) from the business logic and data (Model) by using a ViewModel. Using data bindings and event handling, it improves code organization and makes faster reactive GUI.

Block Cipher modes of Operation

CBC (Cipher Block Chaining)

Cipher Block Chaining (CBC) links each plaintext block with the previous ciphertext block using XOR before encryption, enhancing security by ensuring identical plaintext blocks yield different ciphertext blocks. Pros: High security due to chaining; protects against pattern recognition. Cons: Requires an IV; sequential processing limits parallelism.

ECB (Electronic Codebook)

Electronic Codebook (ECB) encrypts each plaintext block independently with the same key. Pros: Simple implementation; allows parallel processing of blocks. Cons: Low security; identical plaintext blocks produce identical ciphertext, making it vulnerable to pattern analysis.

CFB (Cipher Feedback)

Cipher Feedback (CFB) turns a block cipher into a stream cipher, encrypting small plaintext segments. Pros: Suitable for streaming data; no need for padding. Cons: Requires an IV; sequential processing prevents parallel encryption.

OFB (Output Feedback)

Output Feedback (OFB) mode converts a block cipher into a synchronous stream cipher by encrypting an IV and XORing the result with plaintext. Pros: Error propagation is limited to the corresponding ciphertext segment; suitable for streaming. Cons: Requires an IV; vulnerable to known plaintext attacks if the same IV is reused.

CTR (Counter)

Counter (CTR) mode encrypts a counter value for each block and XORs it with plaintext, allowing blocks to be processed independently. Pros: Enables parallel encryption; no need for padding. Cons: Requires a unique counter for each block to ensure security.

Supported algorithms

Type Algorithms
Classical Cryptography ADFGVX, Atbash, Affine, Caesar, Enigma, Playfair, Vigenere
Block Ciphers AES, BLOWFISH, CAMELLIA, CAST5, CAST6, DES, DESEDE, DSTU7624, GOST28147, GOST3412-2015, IDEA, NOEKEON, RC2, RC5, RC6, RIJNDAEL, SEED, SHACAL-2, SKIPJACK, SM4, Serpent, TEA, Threefish-1024, Threefish-256, Threefish-512, Tnepres, Twofish, XTEA
Stream Ciphers ARC4, CHACHA, CHACHA20-POLY1305, CHACHA7539, Grain128, Grainv1, HC128, HC256, SALSA20, XSALSA20, ZUC-128, ZUC-256, VMPC, VMPC-KSA3
Asymmetric Ciphers DHIES, ECIES, ECIESwithSHA1, ECIESwithSHA256, ECIESwithSHA384, ECIESwithSHA512, ELGAMAL, IES, RSA
Digests BLAKE2B-160, BLAKE2B-256, BLAKE2B-384, BLAKE2B-512, BLAKE2S-128, BLAKE2S-160, BLAKE2S-224, BLAKE2S-256, BLAKE3-256, DSTU7564-256, DSTU7564-384, DSTU7564-512, GOST3411, GOST3411-2012-256, GOST3411-2012-512, HARAKA-256, HARAKA-512, KECCAK-224, KECCAK-256, KECCAK-288, KECCAK-384, KECCAK-512, MD2, MD4, MD5, PARALLELHASH128-256, PARALLELHASH256-512, RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256, SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128-256, SHAKE256-512, SM3, Skein-1024-1024, Skein-1024-384, Skein-1024-512, Skein-256-128, Skein-256-160, Skein-256-224, Skein-256-256, Skein-512-128, Skein-512-160, Skein-512-224, Skein-512-256, Skein-512-384, Skein-512-512, TIGER, TUPLEHASH128-256, TUPLEHASH256-512, WHIRLPOOL
HMAC HMACDSTU7564-256, HMACDSTU7564-384, HMACDSTU7564-512, HMACGOST3411, HMACGOST3411-2012-256, HMACGOST3411-2012-512, HMACKECCAK224, HMACKECCAK256, HMACKECCAK288, HMACKECCAK384, HMACKECCAK512, HMACMD2, HMACMD4, HMACMD5, HMACRIPEMD128, HMACRIPEMD160, HMACRIPEMD256, HMACRIPEMD320, HMACSHA1, HMACSHA224, HMACSHA256, HMACSHA3-224, HMACSHA3-256, HMACSHA3-384, HMACSHA3-512, HMACSHA384, HMACSHA512, HMACSHA512/224, HMACSHA512/256, HMACSM3, HMACSkein-1024-1024, HMACSkein-1024-384, HMACSkein-1024-512, HMACSkein-256-128, HMACSkein-256-160, HMACSkein-256-224, HMACSkein-256-256, HMACSkein-512-128, HMACSkein-512-160, HMACSkein-512-224, HMACSkein-512-256, HMACSkein-512-384, HMACSkein-512-512, HMACTIGER, HMACWHIRLPOOL
PBKDF2 PBKDF2, PBKDF2WITHASCII, PBKDF2WITHHMACGOST3411, PBKDF2WITHHMACSHA224, PBKDF2WITHHMACSHA256, PBKDF2WITHHMACSHA3-224, PBKDF2WITHHMACSHA3-256, PBKDF2WITHHMACSHA3-384, PBKDF2WITHHMACSHA3-512, PBKDF2WITHHMACSHA384, PBKDF2WITHHMACSHA512, PBKDF2WITHHMACSM3

Screenshots

JFXCrypto

JFXCrypto

JFXCrypto

JFXCrypto

Contributing and support

Feel free to contribute by opening issues or creating a pull request. Any help is appreciated :)

simplejavacrypter's People

Contributors

dependabot[bot] avatar graymamoru avatar masterflomaster1 avatar vsmng avatar

Stargazers

 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

simplejavacrypter's Issues

JCE cannot authenticate the provider BC

In block cipher page after generate key, Salt > key > generate

i have this error

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
at dev.masterflomaster1.jfxc.crypto.SecurityUtils.generatePasswordBasedKey(SecurityUtils.java:89)
at dev.masterflomaster1.jfxc.gui.page.UIElementFactory.lambda$createPasswordSettingsModal$3(UIElementFactory.java:100)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Node.fireEvent(Node.java:8923)
at javafx.scene.control.Button.fire(Button.java:203)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3894)
at javafx.scene.Scene.processMouseEvent(Scene.java:1887)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2620)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at dev.masterflomaster1.jfxc.crypto.SecurityUtils.generatePasswordBasedKey(SecurityUtils.java:87)
... 58 more
Caused by: java.lang.RuntimeException: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
at dev.masterflomaster1.jfxc.crypto.PbeImpl.lambda$asyncHash$0(PbeImpl.java:23)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
... 1 more
Caused by: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
at java.base/javax.crypto.JceSecurity.getInstance(JceSecurity.java:131)
at java.base/javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:208)
at dev.masterflomaster1.jfxc.crypto.PbeImpl.lambda$asyncHash$0(PbeImpl.java:20)
... 2 more

Iam using JDK 17.0.10 and bcprov-jdk15to18-1.78.1.jar. Can you help me to solve this error ? I found the same error in stackoverflow but i cant fix it.

Unknown ASCII popping in plain text after decryption

Plain text - testonetwothree
Output text after encryption and then decryption on DES - ¥hœ@9�mLÿþt e s t o n e t w o t h r e e "
ãÔYÈt„t o n e t w o t h r e e

Same thing is happening in others as well. Plus ioexception is there until i comment CipherOut.close link from Ciphers package.

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.