Skip to content

Jasypt Encryption and Decryption Online

Jasypt (Java Simplified Encryption) is a popular Java library used to encrypt and decrypt sensitive data such as passwords, API keys, and configuration values in Spring Boot and enterprise applications.

This free online Jasypt encryption and decryption tool helps you quickly encrypt plain text or decrypt Jasypt-encrypted values instantly. It supports both one-way password hashing and two-way PBE-based encryption. Two-way mode supports two legacy algorithms, PBEWithMD5AndDES and PBEWithMD5AndTripleDES.

Jasypt Encryption

Jasypt Decryption

Supported Jasypt algorithms and settings

Jasypt is a Java library; the algorithms available in the library are broader than those supported by this online tool. The following settings describe this tool's two-way encryption and decryption modes.

Online tool compatibility
SettingSupported value
AlgorithmPBEWithMD5AndDES (default) or PBEWithMD5AndTripleDES. Select the algorithm used for the original ciphertext.
Encryption passwordThe Secret key field is the password used to derive the encryption key. Supply the same password for decryption.
Key derivation iterations1,000, using the Jasypt 1.9.2 default. This tool has no custom iteration control.
SaltJasypt's RandomSaltGenerator; the salt is included in the encoded encrypted result. Custom salt configurations are not supported.
Output formatBase64-encoded Jasypt ciphertext. Hexadecimal output and custom ciphertext formats are not supported.
AES and IV settingsPBEWITHHMACSHA512ANDAES_256 and custom IV settings are not supported. Use a local encryptor configured to match the original application.

These DES-based options are for legacy compatibility, not a recommendation for new encryption designs. Do not change an application's algorithm just to make existing ciphertext work in this tool: it must be decrypted with its original settings.

Decrypting Spring Boot ENC(...) values

In a Jasypt Spring Boot configuration, ENC(...) marks an encrypted property. The wrapper is not an encryption algorithm. The master password configured through jasypt.encryptor.password is different from the application password stored inside the encrypted property.

  1. Check the application's encryption algorithm, iteration count, salt configuration and output format against the compatibility table above. AES-based values cannot be decrypted by this tool.
  2. For a property such as spring.datasource.password=ENC(your-ciphertext), copy only the ciphertext inside the parentheses. Remove ENC(, the closing ), and any surrounding configuration quotes. This tool does not remove the wrapper automatically.
  3. Select Decrypt Password in the Jasypt Decryption panel and choose the matching two-way algorithm.
  4. Enter the original master password in Secret key, paste the ciphertext in Jasypt hash or ciphertext, and select Jasypt Decryption.

To use newly encrypted output in a compatible application, wrap the output as ENC(output-from-the-tool) in the property value. Supply the master password separately through your application's secret configuration. Check your integration version and configuration rather than assuming its defaults match this tool. See the Jasypt Spring Boot encryption configuration.

Why Jasypt decryption fails

Error decrypting password does not identify a single cause. Check the original encryption settings before trying again; knowing the password alone is not enough if the other settings differ.

Decryption checks and fixes
Symptom or causeWhat to check
Wrong passwordUse the original encryption master password, not the database password you are trying to recover. Preserve its exact case and whitespace.
Algorithm mismatchDES and Triple DES are not interchangeable. AES-based Jasypt values require a compatible local tool.
Custom iterations, salt or IVCompare the original configuration with the table above. If it differs, decrypt locally using the original settings.
ENC(...) or damaged inputPaste only the complete Base64 ciphertext. Remove the wrapper and configuration quotes; preserve characters such as +, / and trailing =. Do not paste hexadecimal output.
A one-way password hashA hash cannot be decrypted. Choose Match Password and provide a candidate plain-text password for a compatible Jasypt hash. This mode is not a general-purpose hash decoder.
Expired page or request failureA session or network error is separate from an encryption mismatch. Refresh an expired page and retry with test values.

Different encrypted results for the same input and password are expected because encryption uses a random salt. Compare the decrypted plain text, not the ciphertext strings. Without the original encryption password, this tool cannot recover the plain text. See the Jasypt FAQ for configuration-related decryption errors.

Key Features of Jasypt

  • Easy to Use: Jasypt provides a simple and intuitive API, allowing developers to implement encryption and decryption in Java applications without in-depth cryptography knowledge.
  • Algorithm Support: The Jasypt library can use password-based algorithms supported by your Java provider. This online tool supports only the two legacy DES-based options listed above. For direct algorithm-based encryption, you can also try our AES encryption tool or RSA encryption tool.
  • Flexible Configuration: Encryption settings can be configured using Java code or external configuration files, making it easy to manage secret keys and encryption parameters.
  • Built-in Security Practices: Jasypt automatically handles secure salt generation and key derivation iterations to strengthen encrypted output.
  • Framework Integration: Jasypt integrates seamlessly with popular Java frameworks such as Spring and Spring Boot.

Advantages of Using Jasypt

  • Developer Friendly: Simple APIs reduce implementation complexity.
  • Algorithm Flexibility: Supports multiple encryption and password-based encryption techniques.
  • Password-Based Security: Uses passphrases for key derivation, avoiding direct key storage.

Limitations of Jasypt

The overall security of Jasypt-encrypted data depends heavily on the strength of the password or secret key used. Always use strong, unique passwords. For file- or image-level encryption, consider tools such as file encryption or image encryption.

Java example: encrypt and decrypt with matching settings

This complete example uses StandardPBEStringEncryptor with the settings used by this tool. It demonstrates legacy interoperability with Jasypt 1.9.2, the version used by the application, rather than recommending that version or algorithm for a new project.

<dependency>
  <groupId>org.jasypt</groupId>
  <artifactId>jasypt</artifactId>
  <version>1.9.2</version>
</dependency>

Save the following as JasyptRoundTrip.java and run it with that dependency on the classpath. Both encryptors use the same password, algorithm, iterations, salt generator and output format.

import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.salt.RandomSaltGenerator;

public class JasyptRoundTrip {
    private static StandardPBEStringEncryptor encryptor(String password) {
        StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
        encryptor.setPassword(password);
        encryptor.setAlgorithm("PBEWithMD5AndDES");
        encryptor.setKeyObtentionIterations(1000);
        encryptor.setSaltGenerator(new RandomSaltGenerator());
        encryptor.setStringOutputType("base64");
        return encryptor;
    }

    public static void main(String[] args) {
        // Disposable demonstration values only.
        String password = "demo-master-password";
        String plainText = "demo-database-password";
        String encrypted = encryptor(password).encrypt(plainText);
        String decrypted = encryptor(password).decrypt(encrypted);
        if (!plainText.equals(decrypted)) {
            throw new IllegalStateException("Round trip failed");
        }
        System.out.println("Ciphertext: " + encrypted);
        System.out.println("Decrypted: " + decrypted);
    }
}

The decrypted output is demo-database-password. The ciphertext changes between runs because of the random salt.

Try the Java output in this tool

  1. Run the example and copy only the value after Ciphertext:.
  2. Choose Decrypt Password and PBEWithMD5AndDES in the tool.
  3. Use demo-master-password as the secret key and paste the copied ciphertext. Decryption should return demo-database-password.

For the reverse workflow, select Two Way Encryption, encrypt the same test plain text with the same algorithm and password, and pass that output to encryptor(password).decrypt(...) in Java. For Triple DES compatibility, change the example's algorithm to PBEWithMD5AndTripleDES and select that same algorithm in the tool.

❤️ Liked this tool?

If it saved you time, consider buying me a coffee to support future improvements.

Help Others Find This

References