├── jasypt-acegisecurity ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jasypt │ ├── acegisecurity │ ├── PBEPasswordEncoder.java │ └── PasswordEncoder.java │ └── spring │ └── security │ ├── PBEPasswordEncoder.java │ └── PasswordEncoder.java ├── jasypt-dist ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── pom.xml └── src │ ├── artwork │ ├── jasypt-small.png │ ├── jasypt.png │ └── jasypt.svg │ ├── assembly │ └── dist.xml │ ├── main │ └── bin │ │ ├── decrypt.bat │ │ ├── decrypt.sh │ │ ├── digest.bat │ │ ├── digest.sh │ │ ├── encrypt.bat │ │ ├── encrypt.sh │ │ ├── listAlgorithms.bat │ │ └── listAlgorithms.sh │ └── site │ ├── apt │ ├── advancedconfiguration.apt │ ├── bouncy-castle.apt │ ├── cli.apt │ ├── contributing.apt │ ├── dependencies.apt │ ├── download.apt │ ├── easy-usage.apt │ ├── encrypting-binaries.apt │ ├── encrypting-configuration.apt │ ├── encrypting-numbers.apt │ ├── encrypting-passwords.apt │ ├── encrypting-texts.apt │ ├── features.apt │ ├── general-usage.apt │ ├── hibernate.apt │ ├── hibernate3.apt │ ├── index.apt │ ├── javadoc.apt │ ├── jaxb.apt │ ├── lite.apt │ ├── maven.apt │ ├── non-default-providers.apt │ ├── seam2.apt │ ├── spring.apt │ ├── spring2.apt │ ├── spring3.apt │ ├── spring31.apt │ ├── springsecurity.apt │ ├── tapestry.apt │ ├── team.apt │ ├── webconfiguration.apt │ ├── whatsnew17.apt │ ├── whatsnew19.apt │ └── wicket.apt │ ├── fml │ └── faq.fml │ ├── other │ ├── Password Encryption.svg │ └── google-analytics.txt │ ├── resources │ ├── css │ │ └── site.css │ └── images │ │ ├── jasypt-small.png │ │ ├── jasypt.png │ │ ├── passwordEncryption.png │ │ └── webConfig.png │ ├── site.xml │ └── xdoc │ └── howtoencryptuserpasswords.xml ├── jasypt-hibernate3 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jasypt │ │ ├── hibernate │ │ ├── connectionprovider │ │ │ ├── EncryptedPasswordC3P0ConnectionProvider.java │ │ │ ├── EncryptedPasswordDriverManagerConnectionProvider.java │ │ │ └── ParameterNaming.java │ │ ├── encryptor │ │ │ ├── HibernatePBEBigDecimalEncryptor.java │ │ │ ├── HibernatePBEBigIntegerEncryptor.java │ │ │ ├── HibernatePBEByteEncryptor.java │ │ │ ├── HibernatePBEEncryptorRegistry.java │ │ │ └── HibernatePBEStringEncryptor.java │ │ └── type │ │ │ ├── AbstractEncryptedAsStringType.java │ │ │ ├── EncryptedBigDecimalAsStringType.java │ │ │ ├── EncryptedBigDecimalType.java │ │ │ ├── EncryptedBigIntegerAsStringType.java │ │ │ ├── EncryptedBigIntegerType.java │ │ │ ├── EncryptedBinaryType.java │ │ │ ├── EncryptedBooleanAsStringType.java │ │ │ ├── EncryptedByteAsStringType.java │ │ │ ├── EncryptedCalendarAsStringType.java │ │ │ ├── EncryptedDateAsStringType.java │ │ │ ├── EncryptedDoubleAsStringType.java │ │ │ ├── EncryptedFloatAsStringType.java │ │ │ ├── EncryptedIntegerAsStringType.java │ │ │ ├── EncryptedLongAsStringType.java │ │ │ ├── EncryptedShortAsStringType.java │ │ │ ├── EncryptedStringType.java │ │ │ └── ParameterNaming.java │ │ └── hibernate3 │ │ ├── connectionprovider │ │ ├── EncryptedPasswordC3P0ConnectionProvider.java │ │ ├── EncryptedPasswordDriverManagerConnectionProvider.java │ │ └── ParameterNaming.java │ │ ├── encryptor │ │ ├── HibernatePBEBigDecimalEncryptor.java │ │ ├── HibernatePBEBigIntegerEncryptor.java │ │ ├── HibernatePBEByteEncryptor.java │ │ ├── HibernatePBEEncryptorRegistry.java │ │ └── HibernatePBEStringEncryptor.java │ │ └── type │ │ ├── AbstractEncryptedAsStringType.java │ │ ├── EncryptedBigDecimalAsStringType.java │ │ ├── EncryptedBigDecimalType.java │ │ ├── EncryptedBigIntegerAsStringType.java │ │ ├── EncryptedBigIntegerType.java │ │ ├── EncryptedBinaryType.java │ │ ├── EncryptedBooleanAsStringType.java │ │ ├── EncryptedByteAsStringType.java │ │ ├── EncryptedCalendarAsStringType.java │ │ ├── EncryptedDateAsStringType.java │ │ ├── EncryptedDoubleAsStringType.java │ │ ├── EncryptedFloatAsStringType.java │ │ ├── EncryptedIntegerAsStringType.java │ │ ├── EncryptedLongAsStringType.java │ │ ├── EncryptedShortAsStringType.java │ │ ├── EncryptedStringType.java │ │ └── ParameterNaming.java │ └── test │ └── java │ └── org │ └── jasypt │ └── hibernate3 │ ├── model │ └── user │ │ ├── User.hbm.xml │ │ └── User.java │ └── test │ └── TestHibernateTypes.java ├── jasypt-hibernate4 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jasypt │ │ └── hibernate4 │ │ ├── connectionprovider │ │ ├── EncryptedPasswordC3P0ConnectionProvider.java │ │ ├── EncryptedPasswordDriverManagerConnectionProvider.java │ │ └── ParameterNaming.java │ │ ├── encryptor │ │ ├── HibernatePBEBigDecimalEncryptor.java │ │ ├── HibernatePBEBigIntegerEncryptor.java │ │ ├── HibernatePBEByteEncryptor.java │ │ ├── HibernatePBEEncryptorRegistry.java │ │ └── HibernatePBEStringEncryptor.java │ │ └── type │ │ ├── AbstractEncryptedAsStringType.java │ │ ├── EncryptedBigDecimalAsStringType.java │ │ ├── EncryptedBigDecimalType.java │ │ ├── EncryptedBigIntegerAsStringType.java │ │ ├── EncryptedBigIntegerType.java │ │ ├── EncryptedBinaryType.java │ │ ├── EncryptedBooleanAsStringType.java │ │ ├── EncryptedByteAsStringType.java │ │ ├── EncryptedCalendarAsStringType.java │ │ ├── EncryptedDateAsStringType.java │ │ ├── EncryptedDoubleAsStringType.java │ │ ├── EncryptedFloatAsStringType.java │ │ ├── EncryptedIntegerAsStringType.java │ │ ├── EncryptedLongAsStringType.java │ │ ├── EncryptedShortAsStringType.java │ │ ├── EncryptedStringType.java │ │ └── ParameterNaming.java │ └── test │ └── java │ └── org │ └── jasypt │ └── hibernate4 │ ├── model │ └── user │ │ ├── User.hbm.xml │ │ └── User.java │ └── test │ └── TestHibernateTypes.java ├── jasypt-spring2 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jasypt │ │ ├── spring │ │ └── properties │ │ │ ├── EncryptablePreferencesPlaceholderConfigurer.java │ │ │ ├── EncryptablePropertyOverrideConfigurer.java │ │ │ ├── EncryptablePropertyPlaceholderConfigurer.java │ │ │ └── EncryptableServletContextPropertyPlaceholderConfigurer.java │ │ └── spring2 │ │ └── properties │ │ ├── EncryptablePreferencesPlaceholderConfigurer.java │ │ ├── EncryptablePropertyOverrideConfigurer.java │ │ ├── EncryptablePropertyPlaceholderConfigurer.java │ │ └── EncryptableServletContextPropertyPlaceholderConfigurer.java │ └── test │ ├── java │ └── org │ │ └── jasypt │ │ └── spring2 │ │ ├── configuration │ │ └── ConfigurationProperties.java │ │ ├── properties │ │ └── EncryptablePropertyPlaceholderConfigurerTest.java │ │ └── test │ │ └── TestSpringConfiguration.java │ └── resources │ ├── props.properties │ └── spring.xml ├── jasypt-spring3-testapp ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── jasypt │ │ └── spring3testapp │ │ └── web │ │ └── controller │ │ └── Index.java │ ├── resources │ ├── log4j.properties │ └── some.properties │ └── webapp │ ├── META-INF │ └── MANIFEST.MF │ └── WEB-INF │ ├── spring-servlet.xml │ ├── templates │ └── index.jsp │ └── web.xml ├── jasypt-spring3 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jasypt │ │ │ ├── spring │ │ │ └── properties │ │ │ │ ├── EncryptablePreferencesPlaceholderConfigurer.java │ │ │ │ ├── EncryptablePropertyOverrideConfigurer.java │ │ │ │ ├── EncryptablePropertyPlaceholderConfigurer.java │ │ │ │ └── EncryptableServletContextPropertyPlaceholderConfigurer.java │ │ │ └── spring3 │ │ │ ├── properties │ │ │ ├── EncryptablePreferencesPlaceholderConfigurer.java │ │ │ ├── EncryptablePropertyOverrideConfigurer.java │ │ │ ├── EncryptablePropertyPlaceholderConfigurer.java │ │ │ └── EncryptableServletContextPropertyPlaceholderConfigurer.java │ │ │ └── xml │ │ │ └── encryption │ │ │ ├── AbstractEncryptablePropertyLoadingBeanDefinitionParser.java │ │ │ ├── AbstractEncryptionBeanDefinitionParser.java │ │ │ ├── DigesterBeanDefinitionParser.java │ │ │ ├── DigesterConfigBeanDefinitionParser.java │ │ │ ├── DigesterFactoryBean.java │ │ │ ├── EncryptablePropertiesBeanDefinitionParser.java │ │ │ ├── EncryptablePropertiesFactoryBean.java │ │ │ ├── EncryptablePropertyOverrideBeanDefinitionParser.java │ │ │ ├── EncryptablePropertyPlaceholderBeanDefinitionParser.java │ │ │ ├── EncryptionNamespaceHandler.java │ │ │ ├── EncryptorBeanDefinitionParser.java │ │ │ ├── EncryptorConfigBeanDefinitionParser.java │ │ │ ├── EncryptorFactoryBean.java │ │ │ ├── UtilDigesterBeanDefinitionParser.java │ │ │ ├── UtilEncryptorBeanDefinitionParser.java │ │ │ └── jasypt-spring3-encryption-1.xsd │ └── metainf │ │ ├── spring.handlers │ │ └── spring.schemas │ └── test │ ├── java │ └── org │ │ └── jasypt │ │ ├── spring │ │ └── properties │ │ │ └── EncryptablePropertyPlaceholderConfigurerTest.java │ │ └── spring3 │ │ ├── configuration │ │ └── ConfigurationProperties.java │ │ └── test │ │ └── TestSpringConfiguration.java │ └── resources │ ├── props.properties │ └── spring.xml ├── jasypt-spring31-testapp ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── jasypt │ │ └── spring3testapp │ │ └── web │ │ └── controller │ │ └── Index.java │ ├── resources │ ├── log4j.properties │ └── some.properties │ └── webapp │ ├── META-INF │ └── MANIFEST.MF │ └── WEB-INF │ ├── spring-servlet.xml │ ├── templates │ └── index.jsp │ └── web.xml ├── jasypt-spring31 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jasypt │ │ │ └── spring31 │ │ │ ├── properties │ │ │ ├── EncryptablePreferencesPlaceholderConfigurer.java │ │ │ ├── EncryptablePropertiesPropertySource.java │ │ │ ├── EncryptablePropertyOverrideConfigurer.java │ │ │ ├── EncryptablePropertyPlaceholderConfigurer.java │ │ │ ├── EncryptablePropertySourcesPlaceholderConfigurer.java │ │ │ └── EncryptableServletContextPropertyPlaceholderConfigurer.java │ │ │ └── xml │ │ │ └── encryption │ │ │ ├── AbstractEncryptablePropertyLoadingBeanDefinitionParser.java │ │ │ ├── AbstractEncryptionBeanDefinitionParser.java │ │ │ ├── DigesterBeanDefinitionParser.java │ │ │ ├── DigesterConfigBeanDefinitionParser.java │ │ │ ├── DigesterFactoryBean.java │ │ │ ├── EncryptablePropertiesBeanDefinitionParser.java │ │ │ ├── EncryptablePropertiesFactoryBean.java │ │ │ ├── EncryptablePropertyOverrideBeanDefinitionParser.java │ │ │ ├── EncryptablePropertyPlaceholderBeanDefinitionParser.java │ │ │ ├── EncryptionNamespaceHandler.java │ │ │ ├── EncryptorBeanDefinitionParser.java │ │ │ ├── EncryptorConfigBeanDefinitionParser.java │ │ │ ├── EncryptorFactoryBean.java │ │ │ ├── UtilDigesterBeanDefinitionParser.java │ │ │ ├── UtilEncryptorBeanDefinitionParser.java │ │ │ └── jasypt-spring31-encryption-1.xsd │ └── metainf │ │ ├── spring.handlers │ │ └── spring.schemas │ └── test │ └── java │ └── org │ └── jasypt │ └── spring31 │ └── properties │ └── EncryptablePropertyPlaceholderConfigurerTest.java ├── jasypt-springsecurity2 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jasypt │ ├── spring │ └── security2 │ │ ├── PBEPasswordEncoder.java │ │ └── PasswordEncoder.java │ └── springsecurity2 │ └── providers │ └── encoding │ ├── PBEPasswordEncoder.java │ └── PasswordEncoder.java ├── jasypt-springsecurity3 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jasypt │ ├── spring │ └── security3 │ │ ├── PBEPasswordEncoder.java │ │ ├── PasswordEncoder.java │ │ └── TokenBasedRememberMeServices.java │ └── springsecurity3 │ └── authentication │ ├── encoding │ ├── PBEPasswordEncoder.java │ └── PasswordEncoder.java │ └── rememberme │ └── TokenBasedRememberMeServices.java ├── jasypt-wicket13 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jasypt │ ├── wicket │ ├── JasyptCrypt.java │ └── JasyptCryptFactory.java │ └── wicket13 │ ├── JasyptCrypt.java │ └── JasyptCryptFactory.java ├── jasypt-wicket15 ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jasypt │ └── wicket15 │ ├── JasyptCrypt.java │ └── JasyptCryptFactory.java └── jasypt ├── BUILD.txt ├── ChangeLog.txt ├── LICENSE.txt ├── NOTICE.txt ├── README.txt ├── RELEASING.txt ├── USAGE.txt ├── pom.xml └── src ├── assembly └── lite.xml ├── main └── java │ └── org │ └── jasypt │ ├── commons │ └── CommonUtils.java │ ├── contrib │ └── org │ │ └── apache │ │ └── commons │ │ └── codec_1_3 │ │ ├── BinaryDecoder.java │ │ ├── BinaryEncoder.java │ │ ├── Decoder.java │ │ ├── DecoderException.java │ │ ├── Encoder.java │ │ ├── EncoderException.java │ │ └── binary │ │ └── Base64.java │ ├── digest │ ├── ByteDigester.java │ ├── PooledByteDigester.java │ ├── PooledStringDigester.java │ ├── StandardByteDigester.java │ ├── StandardStringDigester.java │ ├── StringDigester.java │ └── config │ │ ├── DigesterConfig.java │ │ ├── EnvironmentDigesterConfig.java │ │ ├── EnvironmentStringDigesterConfig.java │ │ ├── SimpleDigesterConfig.java │ │ ├── SimpleStringDigesterConfig.java │ │ └── StringDigesterConfig.java │ ├── encryption │ ├── BigDecimalEncryptor.java │ ├── BigIntegerEncryptor.java │ ├── ByteEncryptor.java │ ├── StringEncryptor.java │ └── pbe │ │ ├── CleanablePasswordBased.java │ │ ├── NumberUtils.java │ │ ├── PBEBigDecimalCleanablePasswordEncryptor.java │ │ ├── PBEBigDecimalEncryptor.java │ │ ├── PBEBigIntegerCleanablePasswordEncryptor.java │ │ ├── PBEBigIntegerEncryptor.java │ │ ├── PBEByteCleanablePasswordEncryptor.java │ │ ├── PBEByteEncryptor.java │ │ ├── PBEStringCleanablePasswordEncryptor.java │ │ ├── PBEStringEncryptor.java │ │ ├── PasswordBased.java │ │ ├── PooledPBEBigDecimalEncryptor.java │ │ ├── PooledPBEBigIntegerEncryptor.java │ │ ├── PooledPBEByteEncryptor.java │ │ ├── PooledPBEStringEncryptor.java │ │ ├── StandardPBEBigDecimalEncryptor.java │ │ ├── StandardPBEBigIntegerEncryptor.java │ │ ├── StandardPBEByteEncryptor.java │ │ ├── StandardPBEStringEncryptor.java │ │ └── config │ │ ├── EnvironmentPBEConfig.java │ │ ├── EnvironmentStringPBEConfig.java │ │ ├── PBECleanablePasswordConfig.java │ │ ├── PBEConfig.java │ │ ├── SimplePBEConfig.java │ │ ├── SimpleStringPBEConfig.java │ │ ├── StringPBEConfig.java │ │ ├── WebPBEConfig.java │ │ └── WebStringPBEConfig.java │ ├── exceptions │ ├── AlreadyInitializedException.java │ ├── EncryptionInitializationException.java │ ├── EncryptionOperationNotPossibleException.java │ └── PasswordAlreadyCleanedException.java │ ├── intf │ ├── cli │ │ ├── AlgorithmRegistryCLI.java │ │ ├── ArgumentNaming.java │ │ ├── CLIUtils.java │ │ ├── JasyptPBEStringDecryptionCLI.java │ │ ├── JasyptPBEStringEncryptionCLI.java │ │ └── JasyptStringDigestCLI.java │ └── service │ │ └── JasyptStatelessService.java │ ├── normalization │ └── Normalizer.java │ ├── properties │ ├── EncryptableProperties.java │ ├── EncryptablePropertiesEncryptorRegistry.java │ └── PropertyValueEncryptionUtils.java │ ├── registry │ └── AlgorithmRegistry.java │ ├── salt │ ├── ByteArrayFixedSaltGenerator.java │ ├── FixedByteArraySaltGenerator.java │ ├── FixedSaltGenerator.java │ ├── FixedStringSaltGenerator.java │ ├── RandomSaltGenerator.java │ ├── SaltGenerator.java │ ├── StringFixedSaltGenerator.java │ └── ZeroSaltGenerator.java │ ├── util │ ├── binary │ │ ├── BasicBinaryEncryptor.java │ │ ├── BinaryEncryptor.java │ │ └── StrongBinaryEncryptor.java │ ├── digest │ │ └── Digester.java │ ├── numeric │ │ ├── BasicDecimalNumberEncryptor.java │ │ ├── BasicIntegerNumberEncryptor.java │ │ ├── DecimalNumberEncryptor.java │ │ ├── IntegerNumberEncryptor.java │ │ ├── StrongDecimalNumberEncryptor.java │ │ └── StrongIntegerNumberEncryptor.java │ ├── password │ │ ├── BasicPasswordEncryptor.java │ │ ├── ConfigurablePasswordEncryptor.java │ │ ├── PasswordEncryptor.java │ │ ├── StrongPasswordEncryptor.java │ │ └── rfc2307 │ │ │ ├── RFC2307MD5PasswordEncryptor.java │ │ │ ├── RFC2307SHAPasswordEncryptor.java │ │ │ ├── RFC2307SMD5PasswordEncryptor.java │ │ │ └── RFC2307SSHAPasswordEncryptor.java │ └── text │ │ ├── BasicTextEncryptor.java │ │ ├── StrongTextEncryptor.java │ │ └── TextEncryptor.java │ └── web │ └── pbeconfig │ ├── WebPBEConfigFilter.java │ ├── WebPBEConfigHtmlUtils.java │ ├── WebPBEConfigRegistry.java │ ├── WebPBEConfigServlet.java │ ├── WebPBEInitializationContextListener.java │ └── WebPBEInitializer.java └── test ├── java └── org │ └── jasypt │ ├── digest │ ├── PooledStandardStringDigesterThreadedTest.java │ ├── StandardByteDigesterTest.java │ ├── StandardHexadecimalStringDigesterTest.java │ ├── StandardStringDigesterBackwardsCompatibilityTest.java │ ├── StandardStringDigesterInvertedSaltTest.java │ ├── StandardStringDigesterTest.java │ └── StandardStringDigesterThreadedTest.java │ ├── encryption │ └── pbe │ │ ├── AbstractPBEBigDecimalEncryptorTest.java │ │ ├── AbstractPBEBigIntegerEncryptorTest.java │ │ ├── AbstractPBEByteEncryptorTest.java │ │ ├── AbstractPBEStringEncryptorTest.java │ │ ├── AbstractPBEStringEncryptorThreadedTest.java │ │ ├── BouncyCastleByProviderBigDecimalEncryptorTest.java │ │ ├── BouncyCastleByProviderBigIntegerEncryptorTest.java │ │ ├── BouncyCastleByProviderByteEncryptorTest.java │ │ ├── BouncyCastleByProviderNameBigDecimalEncryptorTest.java │ │ ├── BouncyCastleByProviderNameBigIntegerEncryptorTest.java │ │ ├── BouncyCastleByProviderNameByteEncryptorTest.java │ │ ├── BouncyCastleByProviderNameStringEncryptorTest.java │ │ ├── BouncyCastleByProviderStringEncryptorTest.java │ │ ├── HexadecimalPBEWithMD5AndDESStringEncryptorTest.java │ │ ├── PBEWithMD5AndDESBigDecimalEncryptorTest.java │ │ ├── PBEWithMD5AndDESBigIntegerEncryptorTest.java │ │ ├── PBEWithMD5AndDESByteEncryptorTest.java │ │ ├── PBEWithMD5AndDESStringEncryptorTest.java │ │ ├── PBEWithMD5AndDESStringEncryptorThreadedTest.java │ │ ├── PBEWithMD5AndTripleDESBigDecimalEncryptorTest.java │ │ ├── PBEWithMD5AndTripleDESBigIntegerEncryptorTest.java │ │ ├── PBEWithMD5AndTripleDESByteEncryptorTest.java │ │ ├── PBEWithMD5AndTripleDESStringEncryptorTest.java │ │ ├── PBEWithSHA1AndDESedeBigDecimalEncryptorTest.java │ │ ├── PBEWithSHA1AndDESedeBigIntegerEncryptorTest.java │ │ ├── PBEWithSHA1AndDESedeByteEncryptorTest.java │ │ ├── PBEWithSHA1AndDESedeStringEncryptorTest.java │ │ ├── PBEWithSHA1AndRC2_40BigDecimalEncryptorTest.java │ │ ├── PBEWithSHA1AndRC2_40BigIntegerEncryptorTest.java │ │ ├── PBEWithSHA1AndRC2_40ByteEncryptorTest.java │ │ ├── PBEWithSHA1AndRC2_40StringEncryptorTest.java │ │ ├── PooledPBEWithMD5AndDESStringEncryptorThreadedTest.java │ │ ├── SecondEncryptionAfterFailBehaviourTest.java │ │ ├── StandardPBEStringEncryptorBackwardsCompatibilityTest.java │ │ ├── StandardPBEStringEncryptorFixedSalt2BackwardsCompatibilityTest.java │ │ ├── StandardPBEStringEncryptorFixedSalt3BackwardsCompatibilityTest.java │ │ └── StandardPBEStringEncryptorFixedSaltBackwardsCompatibilityTest.java │ ├── normalization │ └── NormalizationTest.java │ ├── properties │ └── EncryptablePropertiesTest.java │ └── util │ ├── binary │ ├── BasicBinaryEncryptorTest.java │ └── StrongBinaryEncryptorTest.java │ ├── digest │ └── MessageDigesterTest.java │ ├── numeric │ ├── BasicDecimalNumberEncryptorTest.java │ ├── BasicIntegerNumberEncryptorTest.java │ ├── StrongDecimalNumberEncryptorTest.java │ └── StrongIntegerNumberEncryptorTest.java │ ├── password │ ├── BasicPasswordEncryptorTest.java │ ├── ConfigurablePasswordEncryptorTest.java │ └── StrongPasswordEncryptorTest.java │ └── text │ ├── BasicTextEncryptorTest.java │ └── StrongTextEncryptorTest.java └── resources └── props.properties /jasypt-acegisecurity/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-ACEGISECURITY 3 | ----------------------------- 4 | 5 | To build JASYPT-ACEGISECURITY you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-ACEGISECURITY 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-acegisecurity-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-acegisecurity/{version}/jasypt-acegisecurity-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-ACEGISECURITY 22 | ------------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-ACEGISECURITY, execute this 25 | from the JASYPT-ACEGISECURITY root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-acegisecurity/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-acegisecurity package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.spring.security2 package as 17 | org.jasypt.springsecurity2.providers.encoding, and deprecated the classes in the old package. 18 | -------------------------------------------------------------------------------- /jasypt-acegisecurity/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-acegisecurity/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-acegisecurity/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-ACEGISECURITY from Maven 2 3 | --------------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-acegisecurity 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-dist/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-dist/src/artwork/jasypt-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/artwork/jasypt-small.png -------------------------------------------------------------------------------- /jasypt-dist/src/artwork/jasypt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/artwork/jasypt.png -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/decrypt.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | set SCRIPT_NAME=decrypt.bat 4 | set EXECUTABLE_CLASS=org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI 5 | set EXEC_CLASSPATH=. 6 | if "%JASYPT_CLASSPATH%" == "" goto computeclasspath 7 | set EXEC_CLASSPATH=%EXEC_CLASSPATH%;%JASYPT_CLASSPATH% 8 | 9 | :computeclasspath 10 | IF "%OS%" == "Windows_NT" setlocal ENABLEDELAYEDEXPANSION 11 | FOR %%c in (%~dp0..\lib\*.jar) DO set EXEC_CLASSPATH=!EXEC_CLASSPATH!;%%c 12 | IF "%OS%" == "Windows_NT" setlocal DISABLEDELAYEDEXPANSION 13 | 14 | set JAVA_EXECUTABLE=java 15 | if "%JAVA_HOME%" == "" goto execute 16 | set JAVA_EXECUTABLE="%JAVA_HOME%\bin\java" 17 | 18 | :execute 19 | %JAVA_EXECUTABLE% -classpath %EXEC_CLASSPATH% %EXECUTABLE_CLASS% %SCRIPT_NAME% %* 20 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/decrypt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_NAME=decrypt.sh 4 | EXECUTABLE_CLASS=org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI 5 | BIN_DIR=`dirname $0` 6 | DIST_DIR=$BIN_DIR/.. 7 | LIB_DIR=$DIST_DIR/lib 8 | EXEC_CLASSPATH="." 9 | 10 | if [ -n "$JASYPT_CLASSPATH" ] 11 | then 12 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$JASYPT_CLASSPATH 13 | fi 14 | 15 | for a in `find $LIB_DIR -name '*.jar'` 16 | do 17 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$a 18 | done 19 | 20 | JAVA_EXECUTABLE=java 21 | if [ -n "$JAVA_HOME" ] 22 | then 23 | JAVA_EXECUTABLE=$JAVA_HOME/bin/java 24 | fi 25 | 26 | if [ "$OSTYPE" = "cygwin" ] 27 | then 28 | EXEC_CLASSPATH=`echo $EXEC_CLASSPATH | sed 's/:/;/g' | sed 's/\/cygdrive\/\([a-z]\)/\1:/g'` 29 | JAVA_EXECUTABLE=`cygpath --unix "$JAVA_EXECUTABLE"` 30 | fi 31 | 32 | "$JAVA_EXECUTABLE" -classpath $EXEC_CLASSPATH $EXECUTABLE_CLASS $SCRIPT_NAME "$@" 33 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/digest.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | set SCRIPT_NAME=digest.bat 4 | set EXECUTABLE_CLASS=org.jasypt.intf.cli.JasyptStringDigestCLI 5 | set EXEC_CLASSPATH=. 6 | if "%JASYPT_CLASSPATH%" == "" goto computeclasspath 7 | set EXEC_CLASSPATH=%EXEC_CLASSPATH%;%JASYPT_CLASSPATH% 8 | 9 | :computeclasspath 10 | IF "%OS%" == "Windows_NT" setlocal ENABLEDELAYEDEXPANSION 11 | FOR %%c in (%~dp0..\lib\*.jar) DO set EXEC_CLASSPATH=!EXEC_CLASSPATH!;%%c 12 | IF "%OS%" == "Windows_NT" setlocal DISABLEDELAYEDEXPANSION 13 | 14 | set JAVA_EXECUTABLE=java 15 | if "%JAVA_HOME%" == "" goto execute 16 | set JAVA_EXECUTABLE="%JAVA_HOME%\bin\java" 17 | 18 | :execute 19 | %JAVA_EXECUTABLE% -classpath %EXEC_CLASSPATH% %EXECUTABLE_CLASS% %SCRIPT_NAME% %* 20 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/digest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_NAME=digest.sh 4 | EXECUTABLE_CLASS=org.jasypt.intf.cli.JasyptStringDigestCLI 5 | BIN_DIR=`dirname $0` 6 | DIST_DIR=$BIN_DIR/.. 7 | LIB_DIR=$DIST_DIR/lib 8 | EXEC_CLASSPATH="." 9 | 10 | if [ -n "$JASYPT_CLASSPATH" ] 11 | then 12 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$JASYPT_CLASSPATH 13 | fi 14 | 15 | for a in `find $LIB_DIR -name '*.jar'` 16 | do 17 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$a 18 | done 19 | 20 | JAVA_EXECUTABLE=java 21 | if [ -n "$JAVA_HOME" ] 22 | then 23 | JAVA_EXECUTABLE=$JAVA_HOME/bin/java 24 | fi 25 | 26 | if [ "$OSTYPE" = "cygwin" ] 27 | then 28 | EXEC_CLASSPATH=`echo $EXEC_CLASSPATH | sed 's/:/;/g' | sed 's/\/cygdrive\/\([a-z]\)/\1:/g'` 29 | JAVA_EXECUTABLE=`cygpath --unix "$JAVA_EXECUTABLE"` 30 | fi 31 | 32 | "$JAVA_EXECUTABLE" -classpath $EXEC_CLASSPATH $EXECUTABLE_CLASS $SCRIPT_NAME "$@" 33 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/encrypt.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | set SCRIPT_NAME=encrypt.bat 4 | set EXECUTABLE_CLASS=org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI 5 | set EXEC_CLASSPATH=. 6 | if "%JASYPT_CLASSPATH%" == "" goto computeclasspath 7 | set EXEC_CLASSPATH=%EXEC_CLASSPATH%;%JASYPT_CLASSPATH% 8 | 9 | :computeclasspath 10 | IF "%OS%" == "Windows_NT" setlocal ENABLEDELAYEDEXPANSION 11 | FOR %%c in (%~dp0..\lib\*.jar) DO set EXEC_CLASSPATH=!EXEC_CLASSPATH!;%%c 12 | IF "%OS%" == "Windows_NT" setlocal DISABLEDELAYEDEXPANSION 13 | 14 | set JAVA_EXECUTABLE=java 15 | if "%JAVA_HOME%" == "" goto execute 16 | set JAVA_EXECUTABLE="%JAVA_HOME%\bin\java" 17 | 18 | :execute 19 | %JAVA_EXECUTABLE% -classpath %EXEC_CLASSPATH% %EXECUTABLE_CLASS% %SCRIPT_NAME% %* 20 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/encrypt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_NAME=encrypt.sh 4 | EXECUTABLE_CLASS=org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI 5 | BIN_DIR=`dirname $0` 6 | DIST_DIR=$BIN_DIR/.. 7 | LIB_DIR=$DIST_DIR/lib 8 | EXEC_CLASSPATH="." 9 | 10 | if [ -n "$JASYPT_CLASSPATH" ] 11 | then 12 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$JASYPT_CLASSPATH 13 | fi 14 | 15 | for a in `find $LIB_DIR -name '*.jar'` 16 | do 17 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$a 18 | done 19 | 20 | JAVA_EXECUTABLE=java 21 | if [ -n "$JAVA_HOME" ] 22 | then 23 | JAVA_EXECUTABLE=$JAVA_HOME/bin/java 24 | fi 25 | 26 | if [ "$OSTYPE" = "cygwin" ] 27 | then 28 | EXEC_CLASSPATH=`echo $EXEC_CLASSPATH | sed 's/:/;/g' | sed 's/\/cygdrive\/\([a-z]\)/\1:/g'` 29 | JAVA_EXECUTABLE=`cygpath --unix "$JAVA_EXECUTABLE"` 30 | fi 31 | 32 | "$JAVA_EXECUTABLE" -classpath $EXEC_CLASSPATH $EXECUTABLE_CLASS $SCRIPT_NAME "$@" 33 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/listAlgorithms.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | set SCRIPT_NAME=listAlgorithms.bat 4 | set EXECUTABLE_CLASS=org.jasypt.intf.cli.AlgorithmRegistryCLI 5 | set EXEC_CLASSPATH=. 6 | if "%JASYPT_CLASSPATH%" == "" goto computeclasspath 7 | set EXEC_CLASSPATH=%EXEC_CLASSPATH%;%JASYPT_CLASSPATH% 8 | 9 | :computeclasspath 10 | IF "%OS%" == "Windows_NT" setlocal ENABLEDELAYEDEXPANSION 11 | FOR %%c in (%~dp0..\lib\*.jar) DO set EXEC_CLASSPATH=!EXEC_CLASSPATH!;%%c 12 | IF "%OS%" == "Windows_NT" setlocal DISABLEDELAYEDEXPANSION 13 | 14 | set JAVA_EXECUTABLE=java 15 | if "%JAVA_HOME%" == "" goto execute 16 | set JAVA_EXECUTABLE="%JAVA_HOME%\bin\java" 17 | 18 | :execute 19 | %JAVA_EXECUTABLE% -classpath %EXEC_CLASSPATH% %EXECUTABLE_CLASS% %SCRIPT_NAME% %* 20 | -------------------------------------------------------------------------------- /jasypt-dist/src/main/bin/listAlgorithms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_NAME=listAlgorithms.sh 4 | EXECUTABLE_CLASS=org.jasypt.intf.cli.AlgorithmRegistryCLI 5 | BIN_DIR=`dirname $0` 6 | DIST_DIR=$BIN_DIR/.. 7 | LIB_DIR=$DIST_DIR/lib 8 | EXEC_CLASSPATH="." 9 | 10 | if [ -n "$JASYPT_CLASSPATH" ] 11 | then 12 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$JASYPT_CLASSPATH 13 | fi 14 | 15 | for a in `find $LIB_DIR -name '*.jar'` 16 | do 17 | EXEC_CLASSPATH=$EXEC_CLASSPATH:$a 18 | done 19 | 20 | JAVA_EXECUTABLE=java 21 | if [ -n "$JAVA_HOME" ] 22 | then 23 | JAVA_EXECUTABLE=$JAVA_HOME/bin/java 24 | fi 25 | 26 | if [ "$OSTYPE" = "cygwin" ] 27 | then 28 | EXEC_CLASSPATH=`echo $EXEC_CLASSPATH | sed 's/:/;/g' | sed 's/\/cygdrive\/\([a-z]\)/\1:/g'` 29 | JAVA_EXECUTABLE=`cygpath --unix "$JAVA_EXECUTABLE"` 30 | fi 31 | 32 | "$JAVA_EXECUTABLE" -classpath $EXEC_CLASSPATH $EXECUTABLE_CLASS $SCRIPT_NAME "$@" 33 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/dependencies.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Dependencies 3 | ------- 4 | 5 | 6 | Java Virtual Machine 7 | 8 | Jasypt needs Java Standard Edition, version 1.4 or higher. 9 | 10 | If you are going to use strong encryption algorithms (like TripleDES), you 11 | may have to download and install the {{{http://java.sun.com/javase/downloads}Java 12 | Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy 13 | Files}}. 14 | 15 | Base dependencies for jasypt 16 | 17 | Since version 1.7, jasypt does not depend on any external libraries when 18 | used with Java version 6 or newer. 19 | 20 | If you are using Java SE version 5 or older, you will need: 21 | 22 | * {{{http://www.icu-project.org/}International Components for Unicode (ICU)}} 3.4.4 or higher 23 | 24 | Also note that from jasypt 1.8, ICU (icu4j) will be used for normalizing Unicode if it is present in 25 | classpath, even if Java >= 6 is used (nevertheless, icu4j and <<>> implementations 26 | are completely compatible). 27 | 28 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/download.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Download 3 | ------- 4 | 5 | 6 | Download Jasypt 7 | 8 | 9 | <>: 1.9.2 (February 25th, 2014) [{{{./whatsnew19.html}WHAT'S NEW IN JASYPT 1.9}}] 10 | 11 | 12 | <<{{{http://sourceforge.net/project/showfiles.php?group_id=183612}DOWNLOAD JASYPT (from SourceForge.net)}}>> 13 | 14 | If you are using Maven for building your project, have a look at 15 | {{{./maven.html}Jasypt + Maven}} for details on adding a dependency on Jasypt. 16 | 17 | Jasypt consists of the following artifacts: 18 | 19 | * <<>> (core) [{{{./changelogs/jasypt/ChangeLog.txt}ChangeLog}}] 20 | 21 | * Spring integration 22 | 23 | * <<>> for Spring Framework 2.0 and 2.5 [{{{./changelogs/jasypt-spring2/ChangeLog.txt}ChangeLog}}] 24 | 25 | * <<>> for Spring Framework 3.0 [{{{./changelogs/jasypt-spring3/ChangeLog.txt}ChangeLog}}] 26 | 27 | * <<>> for Spring Framework 3.1 and newer [{{{./changelogs/jasypt-spring31/ChangeLog.txt}ChangeLog}}] 28 | 29 | * <<>> for Acegi Security 1.0 [{{{./changelogs/jasypt-acegisecurity/ChangeLog.txt}ChangeLog}}] 30 | 31 | * <<>> for Spring Security 2.x [{{{./changelogs/jasypt-springsecurity2/ChangeLog.txt}ChangeLog}}] 32 | 33 | * <<>> for Spring Security 3.x and newer [{{{./changelogs/jasypt-springsecurity3/ChangeLog.txt}ChangeLog}}] 34 | 35 | * Hibernate integration 36 | 37 | * <<>> for Hibernate 3.0, 3.1, 3.2, 3.3, 3.5 and 3.6 [{{{./changelogs/jasypt-hibernate3/ChangeLog.txt}ChangeLog}}] 38 | 39 | * <<>> for Hibernate 4.x and newer [{{{./changelogs/jasypt-hibernate4/ChangeLog.txt}ChangeLog}}] 40 | 41 | * Apache Wicket integration 42 | 43 | * <<>> for Apache Wicket 1.3 and 1.4 [{{{./changelogs/jasypt-wicket13/ChangeLog.txt}ChangeLog}}] 44 | 45 | * <<>> for Apache Wicket 1.5 [{{{./changelogs/jasypt-wicket15/ChangeLog.txt}ChangeLog}}] 46 | 47 | You can also browse the Source Repository {{{./source-repository.html}here}}. 48 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/hibernate3.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Integrating Jasypt with Hibernate 3 | ------- 4 | 5 | This page has been moved 6 | 7 | {{{./hibernate.html}Go to the Hibernate integration page}}. -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/javadoc.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - JavaDoc API 3 | ------- 4 | 5 | 6 | Jasypt JavaDoc API: Current version 7 | 8 | These are the API docs for the latest version of jasypt (1.9.2): 9 | 10 | * jasypt (core) API {{{./api/jasypt/1.9.2/index.html}[Read online]}} 11 | 12 | * jasypt-hibernate3 API {{{./api/jasypt-hibernate3/1.9.2/index.html}[Read online]}} 13 | 14 | * jasypt-hibernate4 API {{{./api/jasypt-hibernate4/1.9.2/index.html}[Read online]}} 15 | 16 | * jasypt-spring2 API {{{./api/jasypt-spring2/1.9.2/index.html}[Read online]}} 17 | 18 | * jasypt-spring3 API {{{./api/jasypt-spring3/1.9.2/index.html}[Read online]}} 19 | 20 | * jasypt-spring31 API {{{./api/jasypt-spring31/1.9.2/index.html}[Read online]}} 21 | 22 | * jasypt-acegisecurity API {{{./api/jasypt-acegisecurity/1.9.2/index.html}[Read online]}} 23 | 24 | * jasypt-springsecurity2 API {{{./api/jasypt-springsecurity2/1.9.2/index.html}[Read online]}} 25 | 26 | * jasypt-springsecurity3 API {{{./api/jasypt-springsecurity3/1.9.2/index.html}[Read online]}} 27 | 28 | * jasypt-wicket13 API {{{./api/jasypt-wicket13/1.9.2/index.html}[Read online]}} 29 | 30 | * jasypt-wicket15 API {{{./api/jasypt-wicket15/1.9.2/index.html}[Read online]}} 31 | 32 | 33 | Older versions 34 | 35 | Jasypt 1.8 36 | 37 | * Jasypt API {{{./api/jasypt/1.8/index.html}[Read online]}} -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/lite.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Using the lite artifact 3 | ------- 4 | 5 | 6 | Using the lite artifact 7 | 8 | Since version 1.7, jasypt includes a lightweight version of the standard jasypt .jar file, in order to reduce the 9 | total size in bytes needed in your application to use jasypt. This is especially helpful when 10 | using jasypt in mobile platforms. 11 | 12 | Jasypt "lite" includes both Standard and Pooled, Byte and String digesters and encryptors. And 13 | it specifically excludes: 14 | 15 | * BigDecimal and BigInteger encryption. 16 | 17 | * The "util" package containing utility classes like <<>> (a 18 | correctly configured StandardStringDigester will be used instead). 19 | 20 | * All Spring/SpringSecurity, Hibernate and Wicket integrations. 21 | 22 | * Web PBE Configuration artifacts. 23 | 24 | * CLI utils. 25 | 26 | * Property file encryption features. 27 | 28 | * "Zero" salt generator. 29 | 30 | If you are using Maven, you can easily include the "lite" jar in your application by specifying 31 | a : 32 | 33 | --- 34 | 35 | org.jasypt 36 | jasypt 37 | {version} 38 | lite 39 | compile 40 | 41 | --- 42 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/maven.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Using Jasypt from Apache Maven 3 | ------- 4 | 5 | 6 | Using Jasypt from Apache Maven 2.x or 3.x 7 | 8 | Adding jasypt to your Maven 2 or Maven 3 project is very easy, 9 | you just need to add the corresponding dependency to your pom.xml: 10 | 11 | --------- 12 | 13 | org.jasypt 14 | jasypt 15 | {version} 16 | compile 17 | 18 | --------- 19 | 20 | Alternatively, by specifying a classifier you can use the artifact, which contains only 21 | the essentials in a much smaller .jar file. [{{{./lite.html}More Info}}]. 22 | 23 | --------- 24 | 25 | org.jasypt 26 | jasypt 27 | {version} 28 | lite 29 | compile 30 | 31 | --------- 32 | 33 | If you are goint to use any integration modules, just add them in the same way: 34 | 35 | --------- 36 | 37 | org.jasypt 38 | jasypt-spring31 39 | {version} 40 | compile 41 | 42 | --------- 43 | 44 | 45 | Using Jasypt from Apache Maven 1.x 46 | 47 | Adding jasypt to your Maven 1.x project is as easy 48 | as it is for Maven 2. Maven 1.x does not support transitive dependencies, but 49 | anyway jasypt has none (except icu4j if you're using Java 5 or older): 50 | 51 | --------- 52 | 53 | org.jasypt 54 | jasypt 55 | {version} 56 | 57 | 61 | 62 | com.ibm.icu 63 | icu4j 64 | 3.4.4 65 | 66 | 67 | --------- 68 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/spring.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Integrating Jasypt with Spring 3 | ------- 4 | 5 | 6 | This page has been moved. 7 | 8 | * {{{./spring2.html}Go to the Spring 2 integration page}}. 9 | 10 | * {{{./spring3.html}Go to the Spring 3.0 integration page}}. 11 | 12 | * {{{./spring31.html}Go to the Spring 3.1 integration page}}. -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/tapestry.apt: -------------------------------------------------------------------------------- 1 | ------- 2 | Jasypt: Java simplified encryption - Integrating Jasypt with Tapestry 3 | ------- 4 | 5 | 6 | Integrating Jasypt with Tapestry 7 | 8 | There is an external article regarding integration of Jaspt with Tapestry: 9 | 10 | {{{http://tawus.wordpress.com/2011/05/06/tapestry-magic-11-integration-with-jasypt-for-encrypting-urls/}Tapestry Magic #11: Integration with Jasypt for encrypting URLs}} 11 | 12 | Author: {{{http://tawus.wordpress.com/}tawus}} 13 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/apt/team.apt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/apt/team.apt -------------------------------------------------------------------------------- /jasypt-dist/src/site/fml/faq.fml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/fml/faq.fml -------------------------------------------------------------------------------- /jasypt-dist/src/site/other/google-analytics.txt: -------------------------------------------------------------------------------- 1 | 3 | 7 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/resources/css/site.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /jasypt-dist/src/site/resources/images/jasypt-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/resources/images/jasypt-small.png -------------------------------------------------------------------------------- /jasypt-dist/src/site/resources/images/jasypt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/resources/images/jasypt.png -------------------------------------------------------------------------------- /jasypt-dist/src/site/resources/images/passwordEncryption.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/resources/images/passwordEncryption.png -------------------------------------------------------------------------------- /jasypt-dist/src/site/resources/images/webConfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/resources/images/webConfig.png -------------------------------------------------------------------------------- /jasypt-dist/src/site/site.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tfredrich/jasypt/e391a261fd88e6ca660db5a27060db0b376241c1/jasypt-dist/src/site/site.xml -------------------------------------------------------------------------------- /jasypt-hibernate3/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-HIBERNATE3 3 | -------------------------- 4 | 5 | To build JASYPT-HIBERNATE3 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-HIBERNATE3 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-hibernate3-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-hibernate3/{version}/jasypt-hibernate3-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-HIBERNATE3 22 | ---------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-HIBERNATE3, execute this 25 | from the JASYPT-HIBERNATE3 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-hibernate3/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-hibernate3 package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.hibernate package as org.jasypt.hibernate3, and deprecated 17 | the classes in the old package. 18 | - Created additional tests 19 | -------------------------------------------------------------------------------- /jasypt-hibernate3/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-hibernate3/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-hibernate3/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-HIBERNATE3 from Maven 2 3 | ------------------------------------ 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-hibernate3 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-hibernate3/src/main/java/org/jasypt/hibernate/connectionprovider/ParameterNaming.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.hibernate.connectionprovider; 21 | 22 | import org.jasypt.hibernate.encryptor.HibernatePBEEncryptorRegistry; 23 | 24 | 25 | 26 | /** 27 | *

28 | * Constant names of the parameters that can be used by a jasypt's 29 | * Hibernate connection provider. 30 | *

31 | * 32 | * @since 1.4 33 | * 34 | * @author Daniel Fernández 35 | * 36 | * @deprecated Will be removed in 1.11. Package org.jasypt.hibernate.connectionprovider 37 | * has been renamed as org.jasypt.hibernate3.connectionprovider. 38 | * 39 | */ 40 | public final class ParameterNaming { 41 | 42 | 43 | /** 44 | * Property in hibernate.cfg.xml or 45 | * hibernate.properties which contains the registered name 46 | * (in {@link HibernatePBEEncryptorRegistry}) of the encryptor which 47 | * will be used to decrypt the datasource parameters. 48 | */ 49 | public static final String ENCRYPTOR_REGISTERED_NAME = 50 | "hibernate.connection.encryptor_registered_name"; 51 | 52 | 53 | private ParameterNaming() { 54 | super(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /jasypt-hibernate3/src/main/java/org/jasypt/hibernate3/connectionprovider/ParameterNaming.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.hibernate3.connectionprovider; 21 | 22 | import org.jasypt.hibernate3.encryptor.HibernatePBEEncryptorRegistry; 23 | 24 | 25 | 26 | /** 27 | *

28 | * Constant names of the parameters that can be used by a jasypt's 29 | * Hibernate connection provider. 30 | *

31 | * 32 | * @since 1.9.0 (class existed in package 33 | * org.jasypt.hibernate.connectionprovider since 1.4) 34 | * 35 | * @author Daniel Fernández 36 | * 37 | */ 38 | public final class ParameterNaming { 39 | 40 | 41 | /** 42 | * Property in hibernate.cfg.xml or 43 | * hibernate.properties which contains the registered name 44 | * (in {@link HibernatePBEEncryptorRegistry}) of the encryptor which 45 | * will be used to decrypt the datasource parameters. 46 | */ 47 | public static final String ENCRYPTOR_REGISTERED_NAME = 48 | "hibernate.connection.encryptor_registered_name"; 49 | 50 | 51 | private ParameterNaming() { 52 | super(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /jasypt-hibernate3/src/test/java/org/jasypt/hibernate3/model/user/User.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hibernateStringEncryptor 7 | 8 | 9 | hibernateStringEncryptor 10 | 11 | 12 | hibernateByteEncryptor 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-hibernate4/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-HIBERNATE4 3 | -------------------------- 4 | 5 | To build JASYPT-HIBERNATE4 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-HIBERNATE4 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-hibernate4-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-hibernate4/{version}/jasypt-hibernate4-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-HIBERNATE4 22 | ---------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-HIBERNATE4, execute this 25 | from the JASYPT-HIBERNATE4 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-hibernate4/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Created new jasypt-hibernate4 module for Hibernate 4 integration. 16 | - Created additional tests 17 | -------------------------------------------------------------------------------- /jasypt-hibernate4/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-hibernate4/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-hibernate4/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-HIBERNATE4 from Maven 2 3 | ------------------------------------ 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-hibernate4 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-hibernate4/src/main/java/org/jasypt/hibernate4/connectionprovider/ParameterNaming.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.hibernate4.connectionprovider; 21 | 22 | import org.jasypt.hibernate4.encryptor.HibernatePBEEncryptorRegistry; 23 | 24 | 25 | 26 | /** 27 | *

28 | * Constant names of the parameters that can be used by a jasypt's 29 | * Hibernate connection provider. 30 | *

31 | * 32 | * @since 1.9.0 33 | * 34 | * @author Daniel Fernández 35 | * 36 | */ 37 | public final class ParameterNaming { 38 | 39 | 40 | /** 41 | * Property in hibernate.cfg.xml or 42 | * hibernate.properties which contains the registered name 43 | * (in {@link HibernatePBEEncryptorRegistry}) of the encryptor which 44 | * will be used to decrypt the datasource parameters. 45 | */ 46 | public static final String ENCRYPTOR_REGISTERED_NAME = 47 | "hibernate.connection.encryptor_registered_name"; 48 | 49 | 50 | private ParameterNaming() { 51 | super(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /jasypt-hibernate4/src/test/java/org/jasypt/hibernate4/model/user/User.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hibernateStringEncryptor 7 | 8 | 9 | hibernateStringEncryptor 10 | 11 | 12 | hibernateByteEncryptor 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-spring2/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-SPRING2 3 | ----------------------- 4 | 5 | To build JASYPT-SPRING2 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-SPRING2 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-spring2-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-spring2/{version}/jasypt-spring2-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-SPRING2 22 | ------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-SPRING2, execute this 25 | from the JASYPT-SPRING2 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-spring2/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | - Fixed EncryptablePreferencesPlaceholderConfigurer not applying value decryption when needed. 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-spring2 package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.spring package as org.jasypt.spring2, and deprecated 17 | the classes in the old package. 18 | - Created additional tests 19 | -------------------------------------------------------------------------------- /jasypt-spring2/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-spring2/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-spring2/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-SPRING2 from Maven 2 3 | --------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-spring2 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-spring2/src/test/java/org/jasypt/spring2/configuration/ConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.spring2.configuration; 21 | 22 | /** 23 | * 24 | * @author Soraya Sánchez 25 | * 26 | */ 27 | public class ConfigurationProperties { 28 | 29 | private String location; 30 | private String locatinPlainValue; 31 | private String locationEncryptedValue; 32 | 33 | 34 | public ConfigurationProperties() { 35 | super(); 36 | } 37 | 38 | public String getLocation() { 39 | return this.location; 40 | } 41 | 42 | public void setLocation(String location) { 43 | this.location = location; 44 | } 45 | 46 | public String getLocatinPlainValue() { 47 | return this.locatinPlainValue; 48 | } 49 | 50 | public void setLocationPlainValue(String locatinPlainValue) { 51 | this.locatinPlainValue = locatinPlainValue; 52 | } 53 | 54 | public String getLocationEncryptedValue() { 55 | return this.locationEncryptedValue; 56 | } 57 | 58 | public void setLocationEncryptedValue(String locatinEncryptedValue) { 59 | this.locationEncryptedValue = locatinEncryptedValue; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /jasypt-spring2/src/test/resources/props.properties: -------------------------------------------------------------------------------- 1 | location=ENC(v0z0uGQRucwfBau0e+gB6A\=\=) 2 | location.plain.value=Spain 3 | location.encrypted.value=v0z0uGQRucwfBau0e+gB6A\=\= 4 | -------------------------------------------------------------------------------- /jasypt-spring3-testapp/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger = WARN, stdout 2 | 3 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d %5p [%c{1}] (%F:%L) - %m%n 6 | -------------------------------------------------------------------------------- /jasypt-spring3-testapp/src/main/resources/some.properties: -------------------------------------------------------------------------------- 1 | country.name=ENC(zl94ORjq8JUSN/c5xGgVxomrMd5bf9K4) 2 | city.name=Penguin City 3 | -------------------------------------------------------------------------------- /jasypt-spring3-testapp/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /jasypt-spring3-testapp/src/main/webapp/WEB-INF/templates/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %><%@ 2 | taglib prefix="s" uri="http://www.springframework.org/tags" %><%@ 3 | taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ 4 | page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 5 | 6 | 7 | 8 | 9 | Jasypt Spring3 Test Application 10 | 11 | 12 | 13 | 14 | 15 | 16 |

This is a JSP

17 | 18 |
19 | 20 |
21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /jasypt-spring3-testapp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | jasypt-spring3-testapp 8 | 9 | 10 | 60 11 | 12 | 13 | 14 | spring 15 | org.springframework.web.servlet.DispatcherServlet 16 | 1 17 | 18 | 19 | 20 | 21 | spring 22 | / 23 | 24 | 25 | 26 | index 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /jasypt-spring3/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-SPRING3 3 | ----------------------- 4 | 5 | To build JASYPT-SPRING3 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-SPRING3 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-spring3-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-spring3/{version}/jasypt-spring3-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-SPRING3 22 | ------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-SPRING3, execute this 25 | from the JASYPT-SPRING3 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-spring3/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | - Fixed EncryptablePreferencesPlaceholderConfigurer not applying value decryption when needed. 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-spring3 package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.spring package as org.jasypt.spring3, and deprecated 17 | the classes in the old package. 18 | - Created the "encryption" XML namespace, containing tags for: 19 | * Encryptors 20 | * PBE encryptor config objects: 21 | * PBE byte encryptor objects: 22 | * PBE string encryptor objects: 23 | * PBE big decimal encryptor objects: 24 | * PBE big integer encryptor objects: 25 | * Digesters 26 | * Digester config objects: 27 | * Digester byte digester objects: 28 | * Digester string digester objects: 29 | * Util encryptors/digesters 30 | * Basic text encryptor objects: 31 | * Strong text encryptor objects: 32 | * Basic password encryptor objects: 33 | * Strong password encryptor objects: 34 | * Configurable password encryptor objects: 35 | * Encryptable properties 36 | * Encryptable properties objects (java.util.Properties): 37 | * Encryptable property placeholder configurer: 38 | * Encryptable property override configurer: 39 | 40 | -------------------------------------------------------------------------------- /jasypt-spring3/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-spring3/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-spring3/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-SPRING3 from Maven 2 3 | --------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-spring3 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-spring3/src/main/java/org/jasypt/spring3/xml/encryption/EncryptablePropertyOverrideBeanDefinitionParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.spring3.xml.encryption; 21 | 22 | import org.jasypt.spring3.properties.EncryptablePropertyOverrideConfigurer; 23 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 24 | import org.springframework.util.StringUtils; 25 | import org.w3c.dom.Element; 26 | 27 | /** 28 | * 29 | * @since 1.9.0 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | final class EncryptablePropertyOverrideBeanDefinitionParser 35 | extends AbstractEncryptablePropertyLoadingBeanDefinitionParser { 36 | 37 | 38 | private static final String ENCRYPTOR_ATTRIBUTE = "encryptor"; 39 | 40 | 41 | EncryptablePropertyOverrideBeanDefinitionParser() { 42 | super(); 43 | } 44 | 45 | 46 | @Override 47 | protected Class getBeanClass(final Element element) { 48 | return EncryptablePropertyOverrideConfigurer.class; 49 | } 50 | 51 | 52 | @Override 53 | protected void doParse(final Element element, final BeanDefinitionBuilder builder) { 54 | 55 | super.doParse(element, builder); 56 | builder.addPropertyValue("ignoreInvalidKeys", 57 | Boolean.valueOf(element.getAttribute("ignore-unresolvable"))); 58 | 59 | final String encryptorBeanName = element.getAttribute(ENCRYPTOR_ATTRIBUTE); 60 | if (StringUtils.hasText(encryptorBeanName)) { 61 | builder.addConstructorArgReference(encryptorBeanName); 62 | } 63 | 64 | } 65 | 66 | 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /jasypt-spring3/src/main/metainf/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.jasypt.org/schema/encryption=org.jasypt.spring3.xml.encryption.EncryptionNamespaceHandler 2 | -------------------------------------------------------------------------------- /jasypt-spring3/src/main/metainf/spring.schemas: -------------------------------------------------------------------------------- 1 | http\://www.jasypt.org/schema/encryption/jasypt-spring3-encryption-1.xsd=org/jasypt/spring3/xml/encryption/jasypt-spring3-encryption-1.xsd 2 | -------------------------------------------------------------------------------- /jasypt-spring3/src/test/java/org/jasypt/spring3/configuration/ConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.spring3.configuration; 21 | 22 | /** 23 | * 24 | * @author Soraya Sánchez 25 | * 26 | */ 27 | public class ConfigurationProperties { 28 | 29 | private String location; 30 | 31 | private String locatinPlainValue; 32 | 33 | private String locationEncryptedValue; 34 | 35 | 36 | public ConfigurationProperties() { 37 | super(); 38 | } 39 | 40 | public String getLocation() { 41 | return location; 42 | } 43 | 44 | public void setLocation(String location) { 45 | this.location = location; 46 | } 47 | 48 | public String getLocatinPlainValue() { 49 | return locatinPlainValue; 50 | } 51 | 52 | public void setLocationPlainValue(String locatinPlainValue) { 53 | this.locatinPlainValue = locatinPlainValue; 54 | } 55 | 56 | public String getLocationEncryptedValue() { 57 | return locationEncryptedValue; 58 | } 59 | 60 | public void setLocationEncryptedValue(String locatinEncryptedValue) { 61 | this.locationEncryptedValue = locatinEncryptedValue; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /jasypt-spring3/src/test/resources/props.properties: -------------------------------------------------------------------------------- 1 | location=ENC(v0z0uGQRucwfBau0e+gB6A\=\=) 2 | location.plain.value=Spain 3 | location.encrypted.value=v0z0uGQRucwfBau0e+gB6A\=\= 4 | -------------------------------------------------------------------------------- /jasypt-spring31-testapp/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger = WARN, stdout 2 | 3 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d %5p [%c{1}] (%F:%L) - %m%n 6 | -------------------------------------------------------------------------------- /jasypt-spring31-testapp/src/main/resources/some.properties: -------------------------------------------------------------------------------- 1 | country.name=ENC(zl94ORjq8JUSN/c5xGgVxomrMd5bf9K4) 2 | city.name=Penguin City 3 | -------------------------------------------------------------------------------- /jasypt-spring31-testapp/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /jasypt-spring31-testapp/src/main/webapp/WEB-INF/templates/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %><%@ 2 | taglib prefix="s" uri="http://www.springframework.org/tags" %><%@ 3 | taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ 4 | page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 5 | 6 | 7 | 8 | 9 | Jasypt Spring3 Test Application 10 | 11 | 12 | 13 | 14 | 15 | 16 |

This is a JSP

17 | 18 |
19 | 20 |
21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /jasypt-spring31-testapp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | jasypt-spring3-testapp 8 | 9 | 10 | 60 11 | 12 | 13 | 14 | spring 15 | org.springframework.web.servlet.DispatcherServlet 16 | 1 17 | 18 | 19 | 20 | 21 | spring 22 | / 23 | 24 | 25 | 26 | index 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /jasypt-spring31/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-SPRING3 3 | ----------------------- 4 | 5 | To build JASYPT-SPRING3 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-SPRING3 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-spring3-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-spring3/{version}/jasypt-spring3-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-SPRING3 22 | ------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-SPRING3, execute this 25 | from the JASYPT-SPRING3 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-spring31/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | - Fixed EncryptablePreferencesPlaceholderConfigurer not applying value decryption when needed. 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-spring31 package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.spring package as org.jasypt.spring31, and deprecated 17 | the classes in the old package. 18 | - Created the "encryption" XML namespace, containing tags for: 19 | * Encryptors 20 | * PBE encryptor config objects: 21 | * PBE byte encryptor objects: 22 | * PBE string encryptor objects: 23 | * PBE big decimal encryptor objects: 24 | * PBE big integer encryptor objects: 25 | * Digesters 26 | * Digester config objects: 27 | * Digester byte digester objects: 28 | * Digester string digester objects: 29 | * Util encryptors/digesters 30 | * Basic text encryptor objects: 31 | * Strong text encryptor objects: 32 | * Basic password encryptor objects: 33 | * Strong password encryptor objects: 34 | * Configurable password encryptor objects: 35 | * Encryptable properties 36 | * Encryptable properties objects (java.util.Properties): 37 | * Encryptable property placeholder configurer: 38 | * Encryptable property override configurer: 39 | - Created an EncryptablePropertiesPropertySource class implementing the new PropertySource interface 40 | for using encrypted properties files as a possible properties source in the new environment 41 | configuration system. 42 | -------------------------------------------------------------------------------- /jasypt-spring31/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-spring31/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-spring31/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-SPRING3 from Maven 2 3 | --------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-spring3 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-spring31/src/main/metainf/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.jasypt.org/schema/encryption=org.jasypt.spring31.xml.encryption.EncryptionNamespaceHandler 2 | -------------------------------------------------------------------------------- /jasypt-spring31/src/main/metainf/spring.schemas: -------------------------------------------------------------------------------- 1 | http\://www.jasypt.org/schema/encryption/jasypt-spring31-encryption-1.xsd=org/jasypt/spring31/xml/encryption/jasypt-spring31-encryption-1.xsd 2 | -------------------------------------------------------------------------------- /jasypt-springsecurity2/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-SPRINGSECURITY2 3 | ------------------------------- 4 | 5 | To build JASYPT-SPRINGSECURITY2 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-SPRINGSECURITY2 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-springsecurity2-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-springsecurity2/{version}/jasypt-springsecurity2-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-SPRINGSECURITY2 22 | --------------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-SPRINGSECURITY2, execute this 25 | from the JASYPT-SPRINGSECURITY2 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-springsecurity2/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-springsecurity2 package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.spring.security2 package as 17 | org.jasypt.springsecurity2.providers.encoding, and deprecated the classes in the old package. 18 | -------------------------------------------------------------------------------- /jasypt-springsecurity2/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-springsecurity2/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-springsecurity2/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-SPRINGSECURITY2 from Maven 2 3 | ----------------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-springsecurity2 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-springsecurity3/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-SPRINGSECURITY3 3 | ------------------------------- 4 | 5 | To build JASYPT-SPRINGSECURITY3 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-SPRINGSECURITY3 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-springsecurity3-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-springsecurity3/{version}/jasypt-springsecurity3-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-SPRINGSECURITY3 22 | --------------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-SPRINGSECURITY3, execute this 25 | from the JASYPT-SPRINGSECURITY3 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-springsecurity3/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-springsecurity3 package from previous monolithic jasypt module. 16 | - Renamed org.jasypt.spring.security3 package as 17 | org.jasypt.springsecurity3.authentication.encoding and 18 | org.jasypt.springsecurity3.authentication.rememberme, and deprecated the classes in the old package. 19 | -------------------------------------------------------------------------------- /jasypt-springsecurity3/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-springsecurity3/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-springsecurity3/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-SPRINGSECURITY3 from Maven 2 3 | ----------------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-springsecurity3 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-wicket13/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-WICKET13 3 | ------------------------ 4 | 5 | To build JASYPT-WICKET13 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-WICKET13 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-wicket13-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-wicket13/{version}/jasypt-wicket13-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-WICKET13 22 | -------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-WICKET13, execute this 25 | from the JASYPT-WICKET13 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-wicket13/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Extracted jasypt-wicket13 package from previous monolithic jasypt module. 16 | -------------------------------------------------------------------------------- /jasypt-wicket13/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-wicket13/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-wicket13/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-WICKET13 from Maven 2 3 | ---------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-wicket13 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt-wicket15/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT-WICKET15 3 | ------------------------ 4 | 5 | To build JASYPT-WICKET15 you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Build and install the project executing, from the JASYPT-WICKET15 10 | project root folder: 11 | 12 | mvn clean:clean install 13 | 14 | And you will get a fresh target/jasypt-wicket15-{version}.jar file. 15 | You will also get it installed in your local repository at: 16 | 17 | $M2_REPO/org/jasypt/jasypt-wicket15/{version}/jasypt-wicket15-{version}.jar 18 | 19 | 20 | 21 | Generating Javadoc for JASYPT-WICKET15 22 | -------------------------------------- 23 | 24 | If you wish to generate the javadoc for JASYPT-WICKET15, execute this 25 | from the JASYPT-WICKET15 root folder: 26 | 27 | mvn javadoc:javadoc 28 | 29 | This will generate the javadoc documentation in HTML format in: 30 | 31 | target/site/apidocs 32 | 33 | 34 | -------------------------------------------------------------------------------- /jasypt-wicket15/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.9.2 3 | ===== 4 | (no changes) 5 | 6 | 7 | 1.9.1 8 | ===== 9 | (no changes) 10 | 11 | 12 | 1.9.0 13 | ===== 14 | 15 | - Created jasypt-wicket15 module, enabling compatibility with version 1.5 of Apache Wicket. 16 | -------------------------------------------------------------------------------- /jasypt-wicket15/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt-wicket15/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt-wicket15/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT-WICKET15 from Maven 2 3 | ---------------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt-wicket15 12 | {version} 13 | compile 14 | 15 | 16 | In order for this to work correctly, you need to have previously installed 17 | jasypt in your local repository (as explained in BUILD.txt) or have a 18 | working internet connection to let maven automatically download jasypt 19 | binaries from Maven 2's central repositories. 20 | -------------------------------------------------------------------------------- /jasypt/BUILD.txt: -------------------------------------------------------------------------------- 1 | 2 | Building JASYPT 3 | --------------- 4 | 5 | To build JASYPT you will need Maven 2. You can get it at: 6 | 7 | http://maven.apache.org 8 | 9 | Also, in order to pass the unit tests, you will need the 10 | Java Unlimited Jurisdiction Policy files installed for the JDK with 11 | which you are going to do the build. 12 | 13 | Build and install the project executing, from the JASYPT 14 | project root folder: 15 | 16 | mvn clean:clean install 17 | 18 | And you will get a fresh target/jasypt-{version}.jar file. 19 | You will also get it installed in your local repository at: 20 | 21 | $M2_REPO/org/jasypt/jasypt/{version}/jasypt-{version}.jar 22 | 23 | 24 | 25 | Generating Javadoc for JASYPT 26 | ----------------------------- 27 | 28 | If you wish to generate the javadoc for JASYPT, execute this from the 29 | JASYPT root folder: 30 | 31 | mvn javadoc:javadoc 32 | 33 | This will generate the javadoc documentation in HTML format in: 34 | 35 | target/site/apidocs 36 | 37 | 38 | -------------------------------------------------------------------------------- /jasypt/README.txt: -------------------------------------------------------------------------------- 1 | 2 | JASYPT: Java Simplified Encryption 3 | ---------------------------------- 4 | 5 | Jasypt (Java Simplified Encryption) is a java library which allows the 6 | developer to add basic encryption capabilities to his/her projects with 7 | minimum effort, and without the need of having deep knowledge on how 8 | cryptography works. 9 | 10 | To learn more and download latest version: 11 | 12 | http://www.jasypt.org 13 | 14 | -------------------------------------------------------------------------------- /jasypt/RELEASING.txt: -------------------------------------------------------------------------------- 1 | In order to prepare a release, this steps have to be taken: 2 | 3 | 1. In settings.xml, these entries must exist: 4 | 5 | 6 | 7 | releases 8 | 9 | [KEYNAME (EMAIL)] 10 | [GPG PASSPHRASE] 11 | 12 | 13 | 14 | 15 | 16 | sonatype-nexus-snapshots 17 | [USER IN SONATYPE NEXUS] 18 | [PASSWORD IN SONATYPE NEXUS] 19 | 20 | 21 | 22 | 2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not. 23 | 24 | 3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface. 25 | 26 | 4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 27 | 28 | 5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 29 | 30 | 6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]" 31 | 32 | 7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html 33 | 34 | 35 | -------------------------------------------------------------------------------- /jasypt/USAGE.txt: -------------------------------------------------------------------------------- 1 | 2 | Using JASYPT from Maven 2 3 | ------------------------- 4 | 5 | 6 | In order to use it in your Maven 2 applications, you will need to add it as 7 | a dependency with: 8 | 9 | 10 | org.jasypt 11 | jasypt 12 | {version} 13 | compile 14 | 15 | 16 | Or, alternatively, you can use the "lite" artifact (see online docs) by 17 | specifying a classifier: 18 | 19 | 20 | org.jasypt 21 | jasypt 22 | {version} 23 | lite 24 | compile 25 | 26 | 27 | In order for this to work correctly, you need to have previously installed 28 | jasypt in your local repository (as explained in BUILD.txt) or have a 29 | working internet connection to let maven automatically download jasypt 30 | binaries from Maven 2's central repositories. 31 | -------------------------------------------------------------------------------- /jasypt/src/assembly/lite.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | lite 8 | 9 | 10 | jar 11 | 12 | 13 | false 14 | 15 | 16 | 17 | ${basedir}/target/classes 18 | 19 | 20 | org/jasypt/commons/**/* 21 | org/jasypt/contrib/**/* 22 | org/jasypt/digest/**/* 23 | org/jasypt/encryption/**/* 24 | org/jasypt/exceptions/**/* 25 | org/jasypt/normalization/**/* 26 | org/jasypt/salt/**/* 27 | 28 | 29 | org/jasypt/encryption/pbe/config/WebPBEConfig.class 30 | org/jasypt/encryption/pbe/config/WebStringPBEConfig.class 31 | org/jasypt/encryption/pbe/PBEBigDecimalEncryptor.class 32 | org/jasypt/encryption/pbe/PBEBigIntegerEncryptor.class 33 | org/jasypt/encryption/pbe/StandardPBEBigDecimalEncryptor.class 34 | org/jasypt/encryption/pbe/StandardPBEBigIntegerEncryptor.class 35 | org/jasypt/encryption/pbe/PooledPBEBigDecimalEncryptor.class 36 | org/jasypt/encryption/pbe/PooledPBEBigIntegerEncryptor.class 37 | org/jasypt/encryption/BigDecimalEncryptor.class 38 | org/jasypt/encryption/BigIntegerEncryptor.class 39 | org/jasypt/salt/ZeroSaltGenerator.class 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/contrib/org/apache/commons/codec_1_3/BinaryDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * IMPORTANT NOTE: This class has been included into Jasypt's source tree from 18 | * Apache Commons-Codec version 1.3 [see http://commons.apache.org/codec], 19 | * licensed under Apache License 2.0 [see http://www.apache.org/licenses/LICENSE-2.0]. 20 | * No modifications have been made to the code of this class except the package name. 21 | */ 22 | 23 | package org.jasypt.contrib.org.apache.commons.codec_1_3; 24 | 25 | /** 26 | * Defines common decoding methods for byte array decoders. 27 | * 28 | * @author Apache Software Foundation 29 | */ 30 | public interface BinaryDecoder extends Decoder { 31 | 32 | /** 33 | * Decodes a byte array and returns the results as a byte array. 34 | * 35 | * @param pArray A byte array which has been encoded with the 36 | * appropriate encoder 37 | * 38 | * @return a byte array that contains decoded content 39 | * 40 | * @throws DecoderException A decoder exception is thrown 41 | * if a Decoder encounters a failure condition during 42 | * the decode process. 43 | */ 44 | byte[] decode(byte[] pArray) throws DecoderException; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/contrib/org/apache/commons/codec_1_3/BinaryEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * IMPORTANT NOTE: This class has been included into Jasypt's source tree from 18 | * Apache Commons-Codec version 1.3 [see http://commons.apache.org/codec], 19 | * licensed under Apache License 2.0 [see http://www.apache.org/licenses/LICENSE-2.0]. 20 | * No modifications have been made to the code of this class except the package name. 21 | */ 22 | 23 | package org.jasypt.contrib.org.apache.commons.codec_1_3; 24 | 25 | /** 26 | * Defines common encoding methods for byte array encoders. 27 | * 28 | * @author Apache Software Foundation 29 | */ 30 | public interface BinaryEncoder extends Encoder { 31 | 32 | /** 33 | * Encodes a byte array and return the encoded data 34 | * as a byte array. 35 | * 36 | * @param pArray Data to be encoded 37 | * 38 | * @return A byte array containing the encoded data 39 | * 40 | * @throws EncoderException thrown if the Encoder 41 | * encounters a failure condition during the 42 | * encoding process. 43 | */ 44 | byte[] encode(byte[] pArray) throws EncoderException; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/contrib/org/apache/commons/codec_1_3/DecoderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * IMPORTANT NOTE: This class has been included into Jasypt's source tree from 18 | * Apache Commons-Codec version 1.3 [see http://commons.apache.org/codec], 19 | * licensed under Apache License 2.0 [see http://www.apache.org/licenses/LICENSE-2.0]. 20 | * No modifications have been made to the code of this class except the package name. 21 | */ 22 | 23 | package org.jasypt.contrib.org.apache.commons.codec_1_3; 24 | 25 | /** 26 | * Thrown when a Decoder has encountered a failure condition during a decode. 27 | * 28 | * @author Apache Software Foundation 29 | */ 30 | public class DecoderException extends Exception { 31 | 32 | /** 33 | * Creates a DecoderException 34 | * 35 | * @param pMessage A message with meaning to a human 36 | */ 37 | public DecoderException(String pMessage) { 38 | super(pMessage); 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/contrib/org/apache/commons/codec_1_3/Encoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * IMPORTANT NOTE: This class has been included into Jasypt's source tree from 18 | * Apache Commons-Codec version 1.3 [see http://commons.apache.org/codec], 19 | * licensed under Apache License 2.0 [see http://www.apache.org/licenses/LICENSE-2.0]. 20 | * No modifications have been made to the code of this class except the package name. 21 | */ 22 | 23 | package org.jasypt.contrib.org.apache.commons.codec_1_3; 24 | 25 | /** 26 | *

Provides the highest level of abstraction for Encoders. 27 | * This is the sister interface of {@link Decoder}. Every implementation of 28 | * Encoder provides this common generic interface whic allows a user to pass a 29 | * generic Object to any Encoder implementation in the codec package.

30 | * 31 | * @author Apache Software Foundation 32 | */ 33 | public interface Encoder { 34 | 35 | /** 36 | * Encodes an "Object" and returns the encoded content 37 | * as an Object. The Objects here may just be byte[] 38 | * or Strings depending on the implementation used. 39 | * 40 | * @param pObject An object ot encode 41 | * 42 | * @return An "encoded" Object 43 | * 44 | * @throws EncoderException an encoder exception is 45 | * thrown if the encoder experiences a failure 46 | * condition during the encoding process. 47 | */ 48 | Object encode(Object pObject) throws EncoderException; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/contrib/org/apache/commons/codec_1_3/EncoderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * IMPORTANT NOTE: This class has been included into Jasypt's source tree from 18 | * Apache Commons-Codec version 1.3 [see http://commons.apache.org/codec], 19 | * licensed under Apache License 2.0 [see http://www.apache.org/licenses/LICENSE-2.0]. 20 | * No modifications have been made to the code of this class except the package name. 21 | */ 22 | 23 | package org.jasypt.contrib.org.apache.commons.codec_1_3; 24 | 25 | /** 26 | * Thrown when there is a failure condition during the encoding process. This 27 | * exception is thrown when an Encoder encounters a encoding specific exception 28 | * such as invalid data, inability to calculate a checksum, characters outside of the 29 | * expected range. 30 | * 31 | * @author Apache Software Foundation 32 | */ 33 | public class EncoderException extends Exception { 34 | 35 | /** 36 | * Creates a new instance of this exception with an useful message. 37 | * 38 | * @param pMessage a useful message relating to the encoder specific error. 39 | */ 40 | public EncoderException(String pMessage) { 41 | super(pMessage); 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/digest/ByteDigester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.digest; 21 | 22 | /** 23 | *

24 | * Common interface for all digesters which receive a byte array message and 25 | * return a byte array digest. 26 | *

27 | *

28 | * For a default implementation, see {@link StandardByteDigester}. 29 | *

30 | * 31 | * @since 1.0 32 | * 33 | * @author Daniel Fernández 34 | * 35 | */ 36 | public interface ByteDigester { 37 | 38 | 39 | /** 40 | *

41 | * Create a digest of the input message. 42 | *

43 | * 44 | * @param message the message to be digested 45 | * @return the digest 46 | */ 47 | public byte[] digest(byte[] message); 48 | 49 | 50 | /** 51 | *

52 | * Check whether a message matches a digest, managing aspects like 53 | * salt, hashing iterations, etc. (if applicable). 54 | *

55 | * 56 | * @param message the message to check 57 | * @param digest the digest to check 58 | * @return TRUE if the message matches the digest, FALSE if not. 59 | */ 60 | public boolean matches(byte[] message, byte[] digest); 61 | 62 | } 63 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/digest/StringDigester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.digest; 21 | 22 | /** 23 | *

24 | * Common interface for all digesters which receive a String message and 25 | * return a String digest. 26 | *

27 | *

28 | * For a default implementation, see {@link StandardStringDigester}. 29 | *

30 | * 31 | * @since 1.0 32 | * 33 | * @author Daniel Fernández 34 | * 35 | */ 36 | public interface StringDigester { 37 | 38 | /** 39 | *

40 | * Create a digest of the input message. 41 | *

42 | * 43 | * @param message the message to be digested 44 | * @return the digest 45 | */ 46 | public String digest(String message); 47 | 48 | 49 | /** 50 | *

51 | * Check whether a message matches a digest, managing aspects like 52 | * salt, hashing iterations, etc. (if applicable). 53 | *

54 | * 55 | * @param message the message to check 56 | * @param digest the digest to check 57 | * @return TRUE if the message matches the digest, FALSE if not. 58 | */ 59 | public boolean matches(String message, String digest); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/BigDecimalEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption; 21 | 22 | import java.math.BigDecimal; 23 | 24 | 25 | 26 | /** 27 | *

28 | * Common interface for all Encryptors which receive a 29 | * BigDecimal (arbitrary precision) message and return a BigDecimal result. 30 | *

31 | *

32 | * Important: The size of the result of encrypting a number, depending 33 | * on the algorithm, may be much bigger (in bytes) than the size of the 34 | * encrypted number itself. For example, encrypting a 4-byte integer can 35 | * result in an encrypted 16-byte number. This can lead the user into 36 | * problems if the encrypted values are to be stored and not enough room 37 | * has been provided. 38 | *

39 | * 40 | * @since 1.2 41 | * 42 | * @author Daniel Fernández 43 | * 44 | */ 45 | public interface BigDecimalEncryptor { 46 | 47 | 48 | /** 49 | * Encrypt the input message 50 | * 51 | * @param message the message to be encrypted 52 | * @return the result of encryption 53 | */ 54 | public BigDecimal encrypt(BigDecimal message); 55 | 56 | 57 | /** 58 | * Decrypt an encrypted message 59 | * 60 | * @param encryptedMessage the encrypted message to be decrypted 61 | * @return the result of decryption 62 | */ 63 | public BigDecimal decrypt(BigDecimal encryptedMessage); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/BigIntegerEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption; 21 | 22 | import java.math.BigInteger; 23 | 24 | 25 | /** 26 | *

27 | * Common interface for all Encryptors which receive a 28 | * BigInteger (arbitrary precision) message and return a BigInteger result. 29 | *

30 | *

31 | * Important: The size of the result of encrypting a number, depending 32 | * on the algorithm, may be much bigger (in bytes) than the size of the 33 | * encrypted number itself. For example, encrypting a 4-byte integer can 34 | * result in an encrypted 16-byte number. This can lead the user into 35 | * problems if the encrypted values are to be stored and not enough room 36 | * has been provided. 37 | *

38 | * 39 | * @since 1.2 40 | * 41 | * @author Daniel Fernández 42 | * 43 | */ 44 | public interface BigIntegerEncryptor { 45 | 46 | 47 | /** 48 | * Encrypt the input message 49 | * 50 | * @param message the message to be encrypted 51 | * @return the result of encryption 52 | */ 53 | public BigInteger encrypt(BigInteger message); 54 | 55 | 56 | /** 57 | * Decrypt an encrypted message 58 | * 59 | * @param encryptedMessage the encrypted message to be decrypted 60 | * @return the result of decryption 61 | */ 62 | public BigInteger decrypt(BigInteger encryptedMessage); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/ByteEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption; 21 | 22 | /** 23 | *

24 | * Common interface for all Encryptors which receive a 25 | * byte array message and return a byte array result. 26 | *

27 | * 28 | * @since 1.0 29 | * 30 | * @author Daniel Fernández 31 | * 32 | */ 33 | public interface ByteEncryptor { 34 | 35 | 36 | /** 37 | * Encrypt the input message 38 | * 39 | * @param message the message to be encrypted 40 | * @return the result of encryption 41 | */ 42 | public byte[] encrypt(byte[] message); 43 | 44 | /** 45 | * Decrypt an encrypted message 46 | * 47 | * @param encryptedMessage the encrypted message to be decrypted 48 | * @return the result of decryption 49 | */ 50 | public byte[] decrypt(byte[] encryptedMessage); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/StringEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption; 21 | 22 | 23 | /** 24 | *

25 | * Common interface for all Encryptors which receive a 26 | * String message and return a String result. 27 | *

28 | * 29 | * @since 1.0 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public interface StringEncryptor { 35 | 36 | 37 | /** 38 | * Encrypt the input message 39 | * 40 | * @param message the message to be encrypted 41 | * @return the result of encryption 42 | */ 43 | public String encrypt(String message); 44 | 45 | 46 | /** 47 | * Decrypt an encrypted message 48 | * 49 | * @param encryptedMessage the encrypted message to be decrypted 50 | * @return the result of decryption 51 | */ 52 | public String decrypt(String encryptedMessage); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/CleanablePasswordBased.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | /** 23 | *

24 | * Common interface for all entities which can be set a password in char[] shape, 25 | * which can be cleaned once the encryptor is initialized so that no immutable 26 | * Strings containing the password are left in memory. 27 | *

28 | * 29 | * @since 1.8 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public interface CleanablePasswordBased extends PasswordBased { 35 | 36 | /** 37 | *

38 | * Sets a password to be used by the encryptor, as a (cleanable) char[]. 39 | *

40 | * 41 | * @since 1.8 42 | * 43 | * @param password the password to be used. 44 | */ 45 | public void setPasswordCharArray(char[] password); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEBigDecimalCleanablePasswordEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | /** 24 | *

25 | * Common interface for all Password Based Encryptors which receive a 26 | * BigDecimal message and return a BigDecimal result, and provide means 27 | * to set passwords as cleanable char[] objects (instead of 28 | * immutable Strings). 29 | *

30 | *

31 | * Important: The size of the result of encrypting a number, depending 32 | * on the algorithm, may be much bigger (in bytes) than the size of the 33 | * encrypted number itself. For example, encrypting a 4-byte integer can 34 | * result in an encrypted 16-byte number. This can lead the user into 35 | * problems if the encrypted values are to be stored and not enough room 36 | * has been provided. 37 | *

38 | *

39 | * For a default implementation, see {@link StandardPBEBigDecimalEncryptor}. 40 | *

41 | * 42 | * @since 1.8 43 | * 44 | * @author Daniel Fernández 45 | * 46 | */ 47 | public interface PBEBigDecimalCleanablePasswordEncryptor 48 | extends PBEBigDecimalEncryptor, CleanablePasswordBased { 49 | 50 | // aggregator interface 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEBigDecimalEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.jasypt.encryption.BigDecimalEncryptor; 23 | 24 | /** 25 | *

26 | * Common interface for all Password Based Encryptors which receive a 27 | * BigDecimal message and return a BigDecimal result. 28 | *

29 | *

30 | * Important: The size of the result of encrypting a number, depending 31 | * on the algorithm, may be much bigger (in bytes) than the size of the 32 | * encrypted number itself. For example, encrypting a 4-byte integer can 33 | * result in an encrypted 16-byte number. This can lead the user into 34 | * problems if the encrypted values are to be stored and not enough room 35 | * has been provided. 36 | *

37 | *

38 | * For a default implementation, see {@link StandardPBEBigDecimalEncryptor}. 39 | *

40 | * 41 | * @since 1.2 42 | * 43 | * @author Daniel Fernández 44 | * 45 | */ 46 | public interface PBEBigDecimalEncryptor 47 | extends BigDecimalEncryptor, PasswordBased { 48 | 49 | // aggregator interface 50 | 51 | } 52 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEBigIntegerCleanablePasswordEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | /** 24 | *

25 | * Common interface for all Password Based Encryptors which receive a BigInteger 26 | * message and return a BigInteger result, and provide means 27 | * to set passwords as cleanable char[] objects (instead of 28 | * immutable Strings). 29 | *

30 | *

31 | * Important: The size of the result of encrypting a number, depending 32 | * on the algorithm, may be much bigger (in bytes) than the size of the 33 | * encrypted number itself. For example, encrypting a 4-byte integer can result 34 | * in an encrypted 16-byte number. This can lead the user into problems if the 35 | * encrypted values are to be stored and not enough room has been provided. 36 | *

37 | *

38 | * For a default implementation, see {@link StandardPBEBigIntegerEncryptor}. 39 | *

40 | * 41 | * @since 1.8 42 | * 43 | * @author Daniel Fernández 44 | * 45 | */ 46 | public interface PBEBigIntegerCleanablePasswordEncryptor 47 | extends PBEBigIntegerEncryptor, CleanablePasswordBased { 48 | 49 | // aggregator interface 50 | 51 | } 52 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEBigIntegerEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.jasypt.encryption.BigIntegerEncryptor; 23 | 24 | /** 25 | *

26 | * Common interface for all Password Based Encryptors which receive a BigInteger 27 | * message and return a BigInteger result. 28 | *

29 | *

30 | * Important: The size of the result of encrypting a number, depending 31 | * on the algorithm, may be much bigger (in bytes) than the size of the 32 | * encrypted number itself. For example, encrypting a 4-byte integer can result 33 | * in an encrypted 16-byte number. This can lead the user into problems if the 34 | * encrypted values are to be stored and not enough room has been provided. 35 | *

36 | *

37 | * For a default implementation, see {@link StandardPBEBigIntegerEncryptor}. 38 | *

39 | * 40 | * @since 1.2 41 | * 42 | * @author Daniel Fernández 43 | * 44 | */ 45 | public interface PBEBigIntegerEncryptor 46 | extends BigIntegerEncryptor, PasswordBased { 47 | 48 | // aggregator interface 49 | 50 | } 51 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEByteCleanablePasswordEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | /** 24 | *

25 | * Common interface for all Password Based Encryptors which receive a 26 | * byte array message and return a byte array result, and provide means 27 | * to set passwords as cleanable char[] objects (instead of 28 | * immutable Strings). 29 | *

30 | *

31 | * For a default implementation, see {@link StandardPBEByteEncryptor}. 32 | *

33 | * 34 | * @since 1.8 35 | * 36 | * @author Daniel Fernández 37 | * 38 | */ 39 | public interface PBEByteCleanablePasswordEncryptor extends PBEByteEncryptor, CleanablePasswordBased { 40 | 41 | // aggregator interface 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEByteEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.jasypt.encryption.ByteEncryptor; 23 | 24 | /** 25 | *

26 | * Common interface for all Password Based Encryptors which receive a 27 | * byte array message and return a byte array result. 28 | *

29 | *

30 | * For a default implementation, see {@link StandardPBEByteEncryptor}. 31 | *

32 | * 33 | * @since 1.0 34 | * 35 | * @author Daniel Fernández 36 | * 37 | */ 38 | public interface PBEByteEncryptor extends ByteEncryptor, PasswordBased { 39 | 40 | // aggregator interface 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEStringCleanablePasswordEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | /** 24 | *

25 | * Common interface for all Password Based Encryptors which receive a 26 | * String message and return a String result, and provide means 27 | * to set passwords as cleanable char[] objects (instead of 28 | * immutable Strings). 29 | *

30 | * For a default implementation, see {@link StandardPBEStringEncryptor}. 31 | *

32 | * 33 | * @since 1.8 34 | * 35 | * @author Daniel Fernández 36 | * 37 | */ 38 | public interface PBEStringCleanablePasswordEncryptor extends PBEStringEncryptor, CleanablePasswordBased { 39 | 40 | // aggregator interface 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PBEStringEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.jasypt.encryption.StringEncryptor; 23 | 24 | /** 25 | *

26 | * Common interface for all Password Based Encryptors which receive a 27 | * String message and return a String result. 28 | *

29 | *

30 | * For a default implementation, see {@link StandardPBEStringEncryptor}. 31 | *

32 | * 33 | * @since 1.0 34 | * 35 | * @author Daniel Fernández 36 | * 37 | */ 38 | public interface PBEStringEncryptor extends StringEncryptor, PasswordBased { 39 | 40 | // aggregator interface 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/PasswordBased.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | /** 23 | *

24 | * Common interface for all entities which can be set a password. 25 | *

26 | * 27 | * @since 1.3 28 | * 29 | * @author Daniel Fernández 30 | * 31 | */ 32 | public interface PasswordBased { 33 | 34 | /** 35 | *

36 | * Sets a password to be used by the encryptor. 37 | *

38 | * 39 | * @param password the password to be used. 40 | */ 41 | public void setPassword(String password); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/encryption/pbe/config/PBECleanablePasswordConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe.config; 21 | 22 | 23 | 24 | /** 25 | *

26 | * Common interface for all PBEConfig implementations that store passwords as char[] instead 27 | * of String and also allow this passwords to be set as char[] instead of Strings. 28 | *

29 | * 30 | * @since 1.8 31 | * 32 | * @author Daniel Fernández 33 | * 34 | */ 35 | public interface PBECleanablePasswordConfig { 36 | 37 | 38 | /** 39 | *

40 | * Return the password set, as a char array. 41 | *

42 | *

43 | * Important: the returned array MUST BE A COPY of the one 44 | * stored in the configuration object. The caller of 45 | * this method is therefore be responsible for cleaning this 46 | * resulting char[]. 47 | *

48 | * 49 | * @since 1.8 50 | * 51 | */ 52 | public char[] getPasswordCharArray(); 53 | 54 | /** 55 | *

56 | * Clean the password stored in this configuration object. 57 | *

58 | *

59 | * A common implementation of this cleaning operation consists of 60 | * iterating the array of chars and setting each of its positions to (char)0. 61 | *

62 | * 63 | * @since 1.8 64 | * 65 | */ 66 | public void cleanPassword(); 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/exceptions/AlreadyInitializedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.exceptions; 21 | 22 | 23 | /** 24 | * Exception thrown when an attempt is made to change the configuration 25 | * of an entity once it has been initialized. 26 | * 27 | * 28 | * @since 1.0 29 | * 30 | * @author Daniel Fernández 31 | * 32 | */ 33 | public final class AlreadyInitializedException extends RuntimeException { 34 | 35 | private static final long serialVersionUID = 4592515503937873874L; 36 | 37 | public AlreadyInitializedException() { 38 | super("Encryption entity already initialized"); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/exceptions/EncryptionInitializationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.exceptions; 21 | 22 | /** 23 | * Exception thrown when an error is raised during initialization of 24 | * an entity. 25 | * 26 | * @since 1.0 27 | * 28 | * @author Daniel Fernández 29 | * 30 | */ 31 | public final class EncryptionInitializationException extends RuntimeException { 32 | 33 | private static final long serialVersionUID = 8929638240023639778L; 34 | 35 | public EncryptionInitializationException() { 36 | super(); 37 | } 38 | 39 | public EncryptionInitializationException(final Throwable t) { 40 | super(t); 41 | } 42 | 43 | public EncryptionInitializationException(final String msg, final Throwable t) { 44 | super(msg, t); 45 | } 46 | 47 | public EncryptionInitializationException(final String msg) { 48 | super(msg); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/exceptions/EncryptionOperationNotPossibleException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.exceptions; 21 | 22 | 23 | /** 24 | *

25 | * General exception thrown when any errors are raised during encryption, 26 | * digesting, etc. 27 | *

28 | *

29 | * It is intended to provide very little information (if any) of the error 30 | * causes, so that encryption internals are not revealed through error 31 | * messages. 32 | *

33 | * 34 | * @since 1.0 35 | * 36 | * @author Daniel Fernández 37 | * 38 | */ 39 | public final class EncryptionOperationNotPossibleException extends RuntimeException { 40 | 41 | private static final long serialVersionUID = 6304674109588715145L; 42 | 43 | public EncryptionOperationNotPossibleException() { 44 | super(); 45 | } 46 | 47 | public EncryptionOperationNotPossibleException(final Throwable t) { 48 | super(t); 49 | } 50 | 51 | public EncryptionOperationNotPossibleException(final String message) { 52 | super(message); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/exceptions/PasswordAlreadyCleanedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.exceptions; 21 | 22 | 23 | /** 24 | * Exception thrown when an attempt is made to access the configured 25 | * password of an encryptor when this password has already been 26 | * cleaned (so that it appears no more as an immutable String in memory). 27 | * 28 | * 29 | * @since 1.8 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public final class PasswordAlreadyCleanedException extends RuntimeException { 35 | 36 | private static final long serialVersionUID = 7988484935273871733L; 37 | 38 | public PasswordAlreadyCleanedException() { 39 | super("Password already cleaned: The encryptor that uses this password has " + 40 | "already been initialized and therefore this password has been cleaned so "+ 41 | "that it is no more present in memory. An exception has been raised when accessing " + 42 | "this property in order to avoid inconsistencies. A possible reason for this error " + 43 | "is that you are using the same PBEConfig object to configure two different " + 44 | "PBE encryptor instances."); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/intf/cli/AlgorithmRegistryCLI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.intf.cli; 21 | 22 | import java.util.Set; 23 | 24 | import org.jasypt.registry.AlgorithmRegistry; 25 | 26 | 27 | /** 28 | *

29 | * This class supports the CLI "listAlgorithms" operation. 30 | *

31 | *

32 | * It should NEVER be used inside your code, only from the supplied 33 | * command-line tools. 34 | *

35 | * 36 | * @since 1.7 37 | * 38 | * @author Daniel Fernández 39 | * 40 | */ 41 | public final class AlgorithmRegistryCLI { 42 | 43 | 44 | /** 45 | *

46 | * CLI execution method. 47 | *

48 | * 49 | * @param args the command execution arguments 50 | */ 51 | public static void main(final String[] args) { 52 | 53 | try { 54 | 55 | final Set digestAlgos = AlgorithmRegistry.getAllDigestAlgorithms(); 56 | final Set pbeAlgos = AlgorithmRegistry.getAllPBEAlgorithms(); 57 | 58 | System.out.println(); 59 | System.out.println("DIGEST ALGORITHMS: " + digestAlgos); 60 | System.out.println(); 61 | System.out.println("PBE ALGORITHMS: " + pbeAlgos); 62 | System.out.println(); 63 | 64 | } catch (Throwable t) { 65 | t.printStackTrace(System.err); 66 | } 67 | 68 | } 69 | 70 | 71 | 72 | /* 73 | * Instantiation is forbidden. 74 | */ 75 | private AlgorithmRegistryCLI() { 76 | super(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/salt/FixedSaltGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.salt; 21 | 22 | 23 | /** 24 | *

25 | * Marker interface for all implementations of {@link SaltGenerator} that 26 | * will always return the same salt (for the same amount of bytes asked). 27 | *

28 | *

29 | * Use of this interface in salt generators enables encryptors to perform 30 | * some performance optimizations whenever they are used. 31 | *

32 | * 33 | * @since 1.9.2 34 | * 35 | * @author Daniel Fernández 36 | * 37 | */ 38 | public interface FixedSaltGenerator extends SaltGenerator { 39 | 40 | // Marker interface - no methods added 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/salt/ZeroSaltGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.salt; 21 | 22 | import java.util.Arrays; 23 | 24 | 25 | /** 26 | *

27 | * This implementation of {@link SaltGenerator} always returns a salt 28 | * of the required length, filled with zero bytes. 29 | *

30 | *

31 | * This class is thread-safe. 32 | *

33 | * 34 | * @since 1.4 35 | * 36 | * @author Daniel Fernández 37 | * 38 | */ 39 | public class ZeroSaltGenerator implements SaltGenerator { 40 | 41 | /** 42 | * Creates a new instance of ZeroSaltGenerator 43 | * 44 | */ 45 | public ZeroSaltGenerator() { 46 | super(); 47 | } 48 | 49 | 50 | /** 51 | * Return salt with the specified byte length. This will return 52 | * an array of zero bytes, with the specified length. 53 | * 54 | * @param lengthBytes length in bytes. 55 | * @return the generated salt. 56 | */ 57 | public byte[] generateSalt(final int lengthBytes) { 58 | final byte[] result = new byte[lengthBytes]; 59 | Arrays.fill(result, (byte)0); 60 | return result; 61 | } 62 | 63 | 64 | /** 65 | * As this salt generator provides a predictable salt, its inclusion 66 | * unencrypted in encryption results 67 | * is not necessary, and in fact not desirable (so that it remains hidden). 68 | * 69 | * @return false 70 | */ 71 | public boolean includePlainSaltInEncryptionResults() { 72 | return false; 73 | } 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/util/binary/BinaryEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.binary; 21 | 22 | 23 | 24 | /** 25 | *

26 | * Common interface for all util classes aimed at binary encryption 27 | *

28 | * 29 | * @since 1.2 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public interface BinaryEncryptor { 35 | 36 | 37 | /** 38 | * Encrypts a byte array 39 | * 40 | * @param binary the byte array to be encrypted. 41 | */ 42 | public byte[] encrypt(byte[] binary); 43 | 44 | 45 | /** 46 | * Decrypts a byte array. 47 | * 48 | * @param encryptedBinary the byte array to be decrypted. 49 | */ 50 | public byte[] decrypt(byte[] encryptedBinary); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/util/numeric/DecimalNumberEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.numeric; 21 | 22 | import java.math.BigDecimal; 23 | 24 | /** 25 | *

26 | * Common interface for all util classes aimed at decimal number encryption. 27 | *

28 | * 29 | * @since 1.2 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public interface DecimalNumberEncryptor { 35 | 36 | 37 | /** 38 | * Encrypts a BigDecimal 39 | * 40 | * @param number the number to be encrypted. 41 | */ 42 | public BigDecimal encrypt(BigDecimal number); 43 | 44 | 45 | /** 46 | * Decrypts a BigDecimal. 47 | * 48 | * @param encryptedNumber the number to be decrypted. 49 | */ 50 | public BigDecimal decrypt(BigDecimal encryptedNumber); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/util/numeric/IntegerNumberEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.numeric; 21 | 22 | import java.math.BigInteger; 23 | 24 | /** 25 | *

26 | * Common interface for all util classes aimed at integer number encryption. 27 | *

28 | * 29 | * @since 1.2 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public interface IntegerNumberEncryptor { 35 | 36 | 37 | /** 38 | * Encrypts a BigInteger 39 | * 40 | * @param number the number to be encrypted. 41 | */ 42 | public BigInteger encrypt(BigInteger number); 43 | 44 | 45 | /** 46 | * Decrypts a BigInteger. 47 | * 48 | * @param encryptedNumber the number to be decrypted. 49 | */ 50 | public BigInteger decrypt(BigInteger encryptedNumber); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/util/password/PasswordEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.password; 21 | 22 | 23 | 24 | 25 | /** 26 | *

27 | * Common interface for all util classes aimed at password encryption. 28 | *

29 | * 30 | * @since 1.2 31 | * 32 | * @author Daniel Fernández 33 | * 34 | */ 35 | public interface PasswordEncryptor { 36 | 37 | 38 | /** 39 | * Encrypts (digests) a password. 40 | * 41 | * @param password the password to be encrypted. 42 | * @return the resulting digest. 43 | */ 44 | public String encryptPassword(String password); 45 | 46 | 47 | /** 48 | * Checks an unencrypted (plain) password against an encrypted one 49 | * (a digest) to see if they match. 50 | * 51 | * @param plainPassword the plain password to check. 52 | * @param encryptedPassword the digest against which to check the password. 53 | * @return true if passwords match, false if not. 54 | */ 55 | public boolean checkPassword(String plainPassword, 56 | String encryptedPassword); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /jasypt/src/main/java/org/jasypt/util/text/TextEncryptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.text; 21 | 22 | 23 | 24 | /** 25 | *

26 | * Common interface for all util classes aimed at text encryption 27 | *

28 | * 29 | * @since 1.2 30 | * 31 | * @author Daniel Fernández 32 | * 33 | */ 34 | public interface TextEncryptor { 35 | 36 | 37 | /** 38 | * Encrypts a message. 39 | * 40 | * @param message the message to be encrypted. 41 | */ 42 | public String encrypt(String message); 43 | 44 | 45 | /** 46 | * Decrypts a message. 47 | * 48 | * @param encryptedMessage the message to be decrypted. 49 | */ 50 | public String decrypt(String encryptedMessage); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderBigDecimalEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 23 | 24 | 25 | public class BouncyCastleByProviderBigDecimalEncryptorTest 26 | extends AbstractPBEBigDecimalEncryptorTest { 27 | 28 | 29 | protected PBEBigDecimalEncryptor createPBEDecimalEncryptor() { 30 | StandardPBEBigDecimalEncryptor encryptor = new StandardPBEBigDecimalEncryptor(); 31 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 32 | encryptor.setProvider(new BouncyCastleProvider()); 33 | return encryptor; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderBigIntegerEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 23 | 24 | 25 | public class BouncyCastleByProviderBigIntegerEncryptorTest 26 | extends AbstractPBEBigIntegerEncryptorTest { 27 | 28 | 29 | protected PBEBigIntegerEncryptor createPBEIntegerEncryptor() { 30 | StandardPBEBigIntegerEncryptor encryptor = new StandardPBEBigIntegerEncryptor(); 31 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 32 | encryptor.setProvider(new BouncyCastleProvider()); 33 | return encryptor; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderByteEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 23 | 24 | 25 | public class BouncyCastleByProviderByteEncryptorTest 26 | extends AbstractPBEByteEncryptorTest { 27 | 28 | 29 | protected StandardPBEByteEncryptor createPBEByteEncryptor() { 30 | StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor(); 31 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 32 | encryptor.setProvider(new BouncyCastleProvider()); 33 | return encryptor; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderNameBigDecimalEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import java.security.Security; 23 | 24 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 25 | 26 | 27 | public class BouncyCastleByProviderNameBigDecimalEncryptorTest 28 | extends AbstractPBEBigDecimalEncryptorTest { 29 | 30 | protected void setUp() throws Exception { 31 | super.setUp(); 32 | Security.addProvider(new BouncyCastleProvider()); 33 | } 34 | 35 | protected PBEBigDecimalEncryptor createPBEDecimalEncryptor() { 36 | StandardPBEBigDecimalEncryptor encryptor = new StandardPBEBigDecimalEncryptor(); 37 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 38 | encryptor.setProviderName("BC"); 39 | return encryptor; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderNameBigIntegerEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import java.security.Security; 23 | 24 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 25 | 26 | 27 | public class BouncyCastleByProviderNameBigIntegerEncryptorTest 28 | extends AbstractPBEBigIntegerEncryptorTest { 29 | 30 | protected void setUp() throws Exception { 31 | super.setUp(); 32 | Security.addProvider(new BouncyCastleProvider()); 33 | } 34 | 35 | protected PBEBigIntegerEncryptor createPBEIntegerEncryptor() { 36 | StandardPBEBigIntegerEncryptor encryptor = new StandardPBEBigIntegerEncryptor(); 37 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 38 | encryptor.setProviderName("BC"); 39 | return encryptor; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderNameByteEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import java.security.Security; 23 | 24 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 25 | 26 | 27 | public class BouncyCastleByProviderNameByteEncryptorTest 28 | extends AbstractPBEByteEncryptorTest { 29 | 30 | protected void setUp() throws Exception { 31 | super.setUp(); 32 | Security.addProvider(new BouncyCastleProvider()); 33 | } 34 | 35 | protected StandardPBEByteEncryptor createPBEByteEncryptor() { 36 | StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor(); 37 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 38 | encryptor.setProviderName("BC"); 39 | return encryptor; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderNameStringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import java.security.Security; 23 | 24 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 25 | 26 | 27 | public class BouncyCastleByProviderNameStringEncryptorTest 28 | extends AbstractPBEStringEncryptorTest { 29 | 30 | protected void setUp() throws Exception { 31 | super.setUp(); 32 | Security.addProvider(new BouncyCastleProvider()); 33 | } 34 | 35 | protected PBEStringEncryptor createPBEStringEncryptor() { 36 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 37 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 38 | encryptor.setProviderName("BC"); 39 | return encryptor; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/BouncyCastleByProviderStringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 23 | 24 | 25 | public class BouncyCastleByProviderStringEncryptorTest 26 | extends AbstractPBEStringEncryptorTest { 27 | 28 | 29 | protected PBEStringEncryptor createPBEStringEncryptor() { 30 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 31 | encryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); 32 | encryptor.setProvider(new BouncyCastleProvider()); 33 | return encryptor; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/HexadecimalPBEWithMD5AndDESStringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class HexadecimalPBEWithMD5AndDESStringEncryptorTest 25 | extends AbstractPBEStringEncryptorTest { 26 | 27 | protected PBEStringEncryptor createPBEStringEncryptor() { 28 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndDES"); 30 | encryptor.setStringOutputType("hex"); 31 | return encryptor; 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndDESBigDecimalEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndDESBigDecimalEncryptorTest 25 | extends AbstractPBEBigDecimalEncryptorTest { 26 | 27 | protected PBEBigDecimalEncryptor createPBEDecimalEncryptor() { 28 | StandardPBEBigDecimalEncryptor encryptor = new StandardPBEBigDecimalEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndDES"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndDESBigIntegerEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndDESBigIntegerEncryptorTest 25 | extends AbstractPBEBigIntegerEncryptorTest { 26 | 27 | protected PBEBigIntegerEncryptor createPBEIntegerEncryptor() { 28 | StandardPBEBigIntegerEncryptor encryptor = new StandardPBEBigIntegerEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndDES"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndDESByteEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | public class PBEWithMD5AndDESByteEncryptorTest 24 | extends AbstractPBEByteEncryptorTest { 25 | 26 | protected StandardPBEByteEncryptor createPBEByteEncryptor() { 27 | StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor(); 28 | encryptor.setAlgorithm("PBEWithMD5AndDES"); 29 | return encryptor; 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndDESStringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndDESStringEncryptorTest 25 | extends AbstractPBEStringEncryptorTest { 26 | 27 | protected PBEStringEncryptor createPBEStringEncryptor() { 28 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndDES"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndDESStringEncryptorThreadedTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | 25 | public class PBEWithMD5AndDESStringEncryptorThreadedTest 26 | extends AbstractPBEStringEncryptorThreadedTest { 27 | 28 | protected PBEStringEncryptor createEncryptor() { 29 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 30 | encryptor.setAlgorithm("PBEWithMD5AndDES"); 31 | return encryptor; 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndTripleDESBigDecimalEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndTripleDESBigDecimalEncryptorTest 25 | extends AbstractPBEBigDecimalEncryptorTest { 26 | 27 | protected PBEBigDecimalEncryptor createPBEDecimalEncryptor() { 28 | StandardPBEBigDecimalEncryptor encryptor = new StandardPBEBigDecimalEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndTripleDES"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndTripleDESBigIntegerEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndTripleDESBigIntegerEncryptorTest 25 | extends AbstractPBEBigIntegerEncryptorTest { 26 | 27 | protected PBEBigIntegerEncryptor createPBEIntegerEncryptor() { 28 | StandardPBEBigIntegerEncryptor encryptor = new StandardPBEBigIntegerEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndTripleDES"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndTripleDESByteEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndTripleDESByteEncryptorTest 25 | extends AbstractPBEByteEncryptorTest { 26 | 27 | protected StandardPBEByteEncryptor createPBEByteEncryptor() { 28 | StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndTripleDES"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithMD5AndTripleDESStringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithMD5AndTripleDESStringEncryptorTest 25 | extends AbstractPBEStringEncryptorTest { 26 | 27 | protected PBEStringEncryptor createPBEStringEncryptor() { 28 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 29 | encryptor.setAlgorithm("PBEWithMD5AndTripleDES"); 30 | return encryptor; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndDESedeBigDecimalEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndDESedeBigDecimalEncryptorTest 25 | extends AbstractPBEBigDecimalEncryptorTest { 26 | 27 | protected PBEBigDecimalEncryptor createPBEDecimalEncryptor() { 28 | StandardPBEBigDecimalEncryptor encryptor = new StandardPBEBigDecimalEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndDESede"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndDESedeBigIntegerEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndDESedeBigIntegerEncryptorTest 25 | extends AbstractPBEBigIntegerEncryptorTest { 26 | 27 | protected PBEBigIntegerEncryptor createPBEIntegerEncryptor() { 28 | StandardPBEBigIntegerEncryptor encryptor = new StandardPBEBigIntegerEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndDESede"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndDESedeByteEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndDESedeByteEncryptorTest 25 | extends AbstractPBEByteEncryptorTest { 26 | 27 | protected StandardPBEByteEncryptor createPBEByteEncryptor() { 28 | StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndDESede"); 30 | return encryptor; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndDESedeStringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndDESedeStringEncryptorTest 25 | extends AbstractPBEStringEncryptorTest { 26 | 27 | protected PBEStringEncryptor createPBEStringEncryptor() { 28 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndDESede"); 30 | return encryptor; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndRC2_40BigDecimalEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndRC2_40BigDecimalEncryptorTest 25 | extends AbstractPBEBigDecimalEncryptorTest { 26 | 27 | protected PBEBigDecimalEncryptor createPBEDecimalEncryptor() { 28 | StandardPBEBigDecimalEncryptor encryptor = new StandardPBEBigDecimalEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndRC2_40"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndRC2_40BigIntegerEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndRC2_40BigIntegerEncryptorTest 25 | extends AbstractPBEBigIntegerEncryptorTest { 26 | 27 | protected PBEBigIntegerEncryptor createPBEIntegerEncryptor() { 28 | StandardPBEBigIntegerEncryptor encryptor = new StandardPBEBigIntegerEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndRC2_40"); 30 | return encryptor; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndRC2_40ByteEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndRC2_40ByteEncryptorTest 25 | extends AbstractPBEByteEncryptorTest { 26 | 27 | protected StandardPBEByteEncryptor createPBEByteEncryptor() { 28 | StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndRC2_40"); 30 | return encryptor; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/encryption/pbe/PBEWithSHA1AndRC2_40StringEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.encryption.pbe; 21 | 22 | 23 | 24 | public class PBEWithSHA1AndRC2_40StringEncryptorTest 25 | extends AbstractPBEStringEncryptorTest { 26 | 27 | protected PBEStringEncryptor createPBEStringEncryptor() { 28 | StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); 29 | encryptor.setAlgorithm("PBEWithSHA1AndRC2_40"); 30 | return encryptor; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/normalization/NormalizationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.normalization; 21 | 22 | import junit.framework.Assert; 23 | import junit.framework.TestCase; 24 | 25 | public class NormalizationTest extends TestCase { 26 | 27 | 28 | public void testNormalizationEquivalence() throws Exception { 29 | 30 | org.jasypt.normalization.Normalizer.initializeIcu4j(); 31 | 32 | boolean executeJavaTextNorm = true; 33 | try { 34 | // Tests might not be executed in Java >= 6 35 | org.jasypt.normalization.Normalizer.initializeJavaTextNormalizer(); 36 | } catch (final Exception e) { 37 | executeJavaTextNorm = false; 38 | } 39 | 40 | 41 | final String msg = "ÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÑÇÆÅßÐáéíóúàèìòùäëïöüâêîôûnçæåÞØÕÃāăþőŏœűŁňć"; 42 | final char[] msgCharArray = msg.toCharArray(); 43 | 44 | String norm1 = com.ibm.icu.text.Normalizer.normalize(msg, com.ibm.icu.text.Normalizer.NFC); 45 | String norm2 = new String(org.jasypt.normalization.Normalizer.normalizeWithIcu4j(msgCharArray)); 46 | String norm3 = (executeJavaTextNorm? new String(org.jasypt.normalization.Normalizer.normalizeWithJavaNormalizer(msgCharArray)) : null); 47 | 48 | Assert.assertEquals(norm1, norm2); 49 | if (executeJavaTextNorm) { 50 | Assert.assertEquals(norm2, norm3); 51 | } 52 | 53 | } 54 | 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/util/binary/BasicBinaryEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.binary; 21 | 22 | 23 | import java.util.Arrays; 24 | 25 | import junit.framework.TestCase; 26 | 27 | public class BasicBinaryEncryptorTest extends TestCase { 28 | 29 | 30 | 31 | public void testEncrypt() throws Exception { 32 | 33 | byte[] message = "This is a Message".getBytes(); 34 | String password = "APASSWORD"; 35 | 36 | BasicBinaryEncryptor textEncryptor = new BasicBinaryEncryptor(); 37 | textEncryptor.setPassword(password); 38 | 39 | for (int i = 0; i < 100; i++) { 40 | byte[] encryptedMessage = textEncryptor.encrypt(message); 41 | assertTrue(Arrays.equals(textEncryptor.decrypt(encryptedMessage), message)); 42 | } 43 | 44 | BasicBinaryEncryptor textEncryptor2 = new BasicBinaryEncryptor(); 45 | textEncryptor2.setPassword(password); 46 | for (int i = 0; i < 100; i++) { 47 | byte[] encryptedMessage = textEncryptor.encrypt(message); 48 | assertTrue(Arrays.equals(textEncryptor2.decrypt(encryptedMessage), message)); 49 | } 50 | 51 | for (int i = 0; i < 100; i++) { 52 | assertFalse(Arrays.equals( 53 | textEncryptor.encrypt(message), 54 | textEncryptor.encrypt(message))); 55 | } 56 | 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/util/binary/StrongBinaryEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.binary; 21 | 22 | 23 | import java.util.Arrays; 24 | 25 | import junit.framework.TestCase; 26 | 27 | public class StrongBinaryEncryptorTest extends TestCase { 28 | 29 | 30 | 31 | public void testEncrypt() throws Exception { 32 | 33 | byte[] message = "This is a Message".getBytes(); 34 | String password = "APASSWORD"; 35 | 36 | StrongBinaryEncryptor textEncryptor = new StrongBinaryEncryptor(); 37 | textEncryptor.setPassword(password); 38 | 39 | for (int i = 0; i < 100; i++) { 40 | byte[] encryptedMessage = textEncryptor.encrypt(message); 41 | assertTrue(Arrays.equals(textEncryptor.decrypt(encryptedMessage), message)); 42 | } 43 | 44 | StrongBinaryEncryptor textEncryptor2 = new StrongBinaryEncryptor(); 45 | textEncryptor2.setPassword(password); 46 | for (int i = 0; i < 100; i++) { 47 | byte[] encryptedMessage = textEncryptor.encrypt(message); 48 | assertTrue(Arrays.equals(textEncryptor2.decrypt(encryptedMessage), message)); 49 | } 50 | 51 | for (int i = 0; i < 100; i++) { 52 | assertFalse(Arrays.equals( 53 | textEncryptor.encrypt(message), 54 | textEncryptor.encrypt(message))); 55 | } 56 | 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/util/numeric/BasicDecimalNumberEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.numeric; 21 | 22 | 23 | import java.math.BigDecimal; 24 | 25 | import junit.framework.TestCase; 26 | 27 | public class BasicDecimalNumberEncryptorTest extends TestCase { 28 | 29 | 30 | 31 | public void testEncrypt() throws Exception { 32 | 33 | BigDecimal message = BigDecimal.valueOf(-12321318473812923.2131928700009987123); 34 | String password = "A PASSWORD1234"; 35 | 36 | BasicDecimalNumberEncryptor encryptor = new BasicDecimalNumberEncryptor(); 37 | encryptor.setPassword(password); 38 | 39 | for (int i = 0; i < 100; i++) { 40 | BigDecimal encryptedMessage = encryptor.encrypt(message); 41 | assertTrue(encryptor.decrypt(encryptedMessage).equals(message)); 42 | } 43 | 44 | BasicDecimalNumberEncryptor textEncryptor2 = new BasicDecimalNumberEncryptor(); 45 | textEncryptor2.setPassword(password); 46 | for (int i = 0; i < 100; i++) { 47 | BigDecimal encryptedMessage = encryptor.encrypt(message); 48 | assertTrue(textEncryptor2.decrypt(encryptedMessage).equals(message)); 49 | } 50 | 51 | for (int i = 0; i < 100; i++) { 52 | assertFalse(encryptor.encrypt(message).equals( 53 | encryptor.encrypt(message))); 54 | } 55 | 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/util/numeric/BasicIntegerNumberEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.numeric; 21 | 22 | 23 | import java.math.BigInteger; 24 | 25 | import junit.framework.TestCase; 26 | 27 | public class BasicIntegerNumberEncryptorTest extends TestCase { 28 | 29 | 30 | 31 | public void testEncrypt() throws Exception { 32 | 33 | BigInteger message = BigInteger.valueOf(-12321318473812923L); 34 | String password = "A PASSWORD1234"; 35 | 36 | BasicIntegerNumberEncryptor encryptor = new BasicIntegerNumberEncryptor(); 37 | encryptor.setPassword(password); 38 | 39 | for (int i = 0; i < 100; i++) { 40 | BigInteger encryptedMessage = encryptor.encrypt(message); 41 | assertTrue(encryptor.decrypt(encryptedMessage).equals(message)); 42 | } 43 | 44 | BasicIntegerNumberEncryptor textEncryptor2 = new BasicIntegerNumberEncryptor(); 45 | textEncryptor2.setPassword(password); 46 | for (int i = 0; i < 100; i++) { 47 | BigInteger encryptedMessage = encryptor.encrypt(message); 48 | assertTrue(textEncryptor2.decrypt(encryptedMessage).equals(message)); 49 | } 50 | 51 | for (int i = 0; i < 100; i++) { 52 | assertFalse(encryptor.encrypt(message).equals( 53 | encryptor.encrypt(message))); 54 | } 55 | 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/util/numeric/StrongDecimalNumberEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.numeric; 21 | 22 | 23 | import java.math.BigDecimal; 24 | 25 | import junit.framework.TestCase; 26 | 27 | public class StrongDecimalNumberEncryptorTest extends TestCase { 28 | 29 | 30 | 31 | public void testEncrypt() throws Exception { 32 | 33 | BigDecimal message = BigDecimal.valueOf(-12321318473812923.2131928700009987123); 34 | String password = "A PASSWORD1234"; 35 | 36 | StrongDecimalNumberEncryptor encryptor = new StrongDecimalNumberEncryptor(); 37 | encryptor.setPassword(password); 38 | 39 | for (int i = 0; i < 100; i++) { 40 | BigDecimal encryptedMessage = encryptor.encrypt(message); 41 | assertTrue(encryptor.decrypt(encryptedMessage).equals(message)); 42 | } 43 | 44 | StrongDecimalNumberEncryptor textEncryptor2 = new StrongDecimalNumberEncryptor(); 45 | textEncryptor2.setPassword(password); 46 | for (int i = 0; i < 100; i++) { 47 | BigDecimal encryptedMessage = encryptor.encrypt(message); 48 | assertTrue(textEncryptor2.decrypt(encryptedMessage).equals(message)); 49 | } 50 | 51 | for (int i = 0; i < 100; i++) { 52 | assertFalse(encryptor.encrypt(message).equals( 53 | encryptor.encrypt(message))); 54 | } 55 | 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /jasypt/src/test/java/org/jasypt/util/numeric/StrongIntegerNumberEncryptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================= 3 | * 4 | * Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ============================================================================= 19 | */ 20 | package org.jasypt.util.numeric; 21 | 22 | 23 | import java.math.BigInteger; 24 | 25 | import junit.framework.TestCase; 26 | 27 | public class StrongIntegerNumberEncryptorTest extends TestCase { 28 | 29 | 30 | 31 | public void testEncrypt() throws Exception { 32 | 33 | BigInteger message = BigInteger.valueOf(-12321318473812923L); 34 | String password = "A PASSWORD1234"; 35 | 36 | StrongIntegerNumberEncryptor encryptor = new StrongIntegerNumberEncryptor(); 37 | encryptor.setPassword(password); 38 | 39 | for (int i = 0; i < 100; i++) { 40 | BigInteger encryptedMessage = encryptor.encrypt(message); 41 | assertTrue(encryptor.decrypt(encryptedMessage).equals(message)); 42 | } 43 | 44 | StrongIntegerNumberEncryptor textEncryptor2 = new StrongIntegerNumberEncryptor(); 45 | textEncryptor2.setPassword(password); 46 | for (int i = 0; i < 100; i++) { 47 | BigInteger encryptedMessage = encryptor.encrypt(message); 48 | assertTrue(textEncryptor2.decrypt(encryptedMessage).equals(message)); 49 | } 50 | 51 | for (int i = 0; i < 100; i++) { 52 | assertFalse(encryptor.encrypt(message).equals( 53 | encryptor.encrypt(message))); 54 | } 55 | 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /jasypt/src/test/resources/props.properties: -------------------------------------------------------------------------------- 1 | location.enc=ENC(v0z0uGQRucwfBau0e+gB6A\=\=) 2 | location.plain=Spain 3 | --------------------------------------------------------------------------------