@Override public String encrypt(final String plaintext, final String passphrase, final Version cryptoVersion) { Preconditions.checkArgument(Version.V1_1.equals(cryptoVersion)); final String cipheredText = newEncryptor(passphrase).encrypt(plaintext); final ObjectNode node = MAPPER.createObjectNode(); node.put(CIPHERED_TEXT_KEY, cipheredText); node.put(VERSION_IDENTIFIER, Version.V1_1.versionStr()); return Crypto.encode(node.toString()); }
@Override public String encrypt(final String plaintext, final String passphrase, final Version cryptoVersion) { Preconditions.checkArgument(Version.V1_0.equals(cryptoVersion)); final String cipheredText = newEncryptor(passphrase).encrypt(plaintext); final ObjectNode node = MAPPER.createObjectNode(); node.put(CIPHERED_TEXT_KEY, cipheredText); node.put(VERSION_IDENTIFIER, Version.V1_0.versionStr()); return Crypto.encode(node.toString()); }
public String encodePassword(String rawPass, Object salt) { this.checkInitialization(); return this.useTextEncryptor ? this.textEncryptor.encrypt(rawPass) : this.pbeStringEncryptor.encrypt(rawPass); }
public static String encodeData(String data, String key) { if (encryptor == null) { initialize(key); } return encryptor.encrypt(data); }
/** {@inheritDoc} */ @Override public String encrypt(String plaintext) { return this.encryptor.encrypt(plaintext); }
/** {@inheritDoc} */ @Override public String encrypt(String plaintext) { return this.encryptor.encrypt(plaintext); }
/** * {@inheritDoc} */ @Override public String encrypt(final String unencryptedString) { return stringEncryptor.encrypt(unencryptedString); }
@Override public String encryptForExternalUse(String stringToEncrypt) { return externalEncryptor.encrypt(stringToEncrypt); }
@Override public String encryptForInternalUse(String stringToEncrypt) { return internalEncryptor.encrypt(stringToEncrypt); }
@Override @Deprecated public String encryptForLegacyExternalUse(String stringToEncrypt) { return legacyExternalEncryptor.encrypt(stringToEncrypt); }
public static String encodeData(final String data, final String key) { if (encryptor == null) { initialize(key); } return encryptor.encrypt(data); }
/** * Encrypts a message, delegating to wrapped encryptor. * * @param message the message to be encrypted. * @return the encryption result. */ public String encrypt(final String message) { if (this.encryptor == null) { throw new EncryptionInitializationException( "Encryptor has not been set into Hibernate wrapper"); } return this.encryptor.encrypt(message); }
@Override public void nullSafeSet( PreparedStatement st, Object value, int index, SharedSessionContractImplementor session ) throws HibernateException, SQLException { ensureEncryptorInit(); if ( value == null ) { st.setNull( index, Types.VARCHAR ); } else { st.setString( index, encryptor.encrypt( value.toString() ) ); } }
public void nullSafeSet(final PreparedStatement st, final Object value, final int index, final SessionImplementor session) throws HibernateException, SQLException { checkInitialization(); if (value == null) { st.setNull(index, sqlType); } else { st.setString(index, this.encryptor.encrypt(convertToString(value))); } }
/** * Encodes a password. This implementation completely ignores salt, * as jasypt's <tt>TextEncryptor</tt> and <tt>PBEStringEncryptor</tt> * normally use a random one. Thus, it can be safely passed as <tt>null</tt>. * * @param rawPass The password to be encoded. * @param salt The salt, which will be ignored. It can be null. */ public String encodePassword(final String rawPass, final Object salt) { checkInitialization(); if (this.useTextEncryptor.booleanValue()) { return this.textEncryptor.encrypt(rawPass); } return this.pbeStringEncryptor.encrypt(rawPass); }
/** * Encodes a password. This implementation completely ignores salt, * as jasypt's <tt>TextEncryptor</tt> and <tt>PBEStringEncryptor</tt> * normally use a random one. Thus, it can be safely passed as <tt>null</tt>. * * @param rawPass The password to be encoded. * @param salt The salt, which will be ignored. It can be null. */ public String encodePassword(final String rawPass, final Object salt) { checkInitialization(); if (this.useTextEncryptor.booleanValue()) { return this.textEncryptor.encrypt(rawPass); } return this.pbeStringEncryptor.encrypt(rawPass); }
log.debug("value before encryption=" + originalValue); strValue = this.encryptor.encrypt(strValue) ;
string = textEncryptor.encrypt(string);
@Override @Transactional public void saveSystemSetting( SettingKey settingKey, Serializable value ) { settingCache.invalidate( settingKey.getName() ); SystemSetting setting = systemSettingStore.getByName( settingKey.getName() ); if ( isConfidential( settingKey.getName() ) ) { value = pbeStringEncryptor.encrypt( value.toString() ); } if ( setting == null ) { setting = new SystemSetting(); setting.setName( settingKey.getName() ); setting.setValue( value ); systemSettingStore.save( setting ); } else { setting.setValue( value ); systemSettingStore.update( setting ); } }