Decrypt value string.

@param value the value
@return the string
488740
public String decryptValue(final String value) {
        try {
            return decryptValuePropagateExceptions(value);
        } catch (final Exception e) {
            LOGGER.error("Could not decrypt value [{}]", value, e);
        }
        return null;
    }
825002
private static String formatValue(String value)
	{
		if(value == null)
			return "";
		
		value = value.trim();
		
		if(value.startsWith("\"")|| value.startsWith("'"))
			value = value.substring(1);
		
		if(value.endsWith("\"")|| value.endsWith("'"))
			value = value.substring(0, value.length() -1);
		
		return value;
	}
195758
public static String serialize(Object value) {
        if (value instanceof String) {
            return (String) value;
        } else if (value instanceof byte[]) {
            return new String((byte[]) value);
        }
802685
public static String encode(String value) {
        byte[] val = value.getBytes(UTF_8);
        return delegate.encode(val);
    }
496141
public function decode($value)
    {
        if ($value === '' || !is_scalar($value)) {
            return false;
        }

        $cryptText = $this->safeBase64Decode($value);
        $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
        $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);
        $decryptText = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->secureKey, $cryptText, MCRYPT_MODE_ECB, $iv);

        return trim($decryptText);
    }
896645
protected static final String decrypt(String value, String cipherKey) {
        int len = value == null ? 0 : value.length();
        
        if (len < 3) {
            return "";
        }
        
        int identifierIndex = value.charAt(0) - 32;
        int associatorIndex = value.charAt(len - 1) - 32;
        String[] cipher = CipherRegistry.getCipher(cipherKey);
        
        return StrUtil.xlate(value.substring(1, len - 1), cipher[associatorIndex], cipher[identifierIndex]);
    }
357052
public static String decode(String value, Charset charset) {
		try {
			return URLDecoder.decode(value, charset.name());
		}
		catch (UnsupportedEncodingException ex) {
			throw new IllegalArgumentException("Characterset is not supported.");
		}
	}
995526
public function decrypt($value)
    {
        $decrypted = $this->blockCipher->decrypt($value);

        // decompress after decryption
        if (!empty($this->compression)) {
            $decompress = new Decompress($this->compression);
            $decrypted  = $decompress($decrypted);
        }

        return $decrypted;
    }
96035
public static String encodeString(final String value) {
    StringBuilder out = new StringBuilder();
    encodeString( value, out );
    return out.toString();
  }
1176959
public function decryptBinary(string $value, string $key): string
    {
        $iv = substr($value, 0, $this->ivLength);
        $encrypted = substr($value, $this->ivLength);
        $key = $this->hashKey($key);
        $opts = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING;
        $ret = openssl_decrypt($encrypted, $this->cipher, $key, $opts, $iv);
        if ($ret === false) {
            throw new \Exception("decryption failed; ".openssl_error_string());
        }
        return $ret;
    }
836176
protected static function unpad($value)
        {
            $pad = ord($value[($length = Inflector::length($value)) - 1]);
            if ($pad and $pad < static::$block) {
                // If the correct padding is present on the string, we will remove
                // it and return the value. Otherwise, we'll throw an exception
                // as the padding appears to have been changed.
                if (preg_match('/' . chr($pad) . '{' . $pad . '}$/', $value)) {
                    return substr($value, 0, $length - $pad);
                } else {
                    throw new Exception("Decryption error. Padding is invalid.");
                }
            }

            return $value;
        }
795729
public static String urlDecode(final String value) {
        if (value == null) {
            return null;
        }

        try {
            return URLDecoder.decode(value, DEFAULT_ENCODING);

        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
    }
480156
public String decryptText(String text)
	throws Exception
	{
		return new String(this.decrypt(toBytesFromByteText(text)), IO.CHARSET);

	}
497402
public String convert(final String value) {

        if(!value.matches(".*[0-9].*")) {
            return value;
        }

        String str = value;
        for(int i=0; i < numMap.length; i++) {
            str = str.replaceAll(String.valueOf(i), numMap[i]);
        }

        return str;

    }
846704
public static String encodeString(String value) {
    if (value == null) {
      return null;
    }
    StringBuilder encoded = new StringBuilder();
    int len = value.length();
    for (int i = 0; i < len; i++) {
      char c = value.charAt(i);
      switch (c) {
        case ARRAY_DELIMITER_CHAR:
        case KEY_VALUE_DELIMITER_CHAR:
        case ESCAPE_CHAR:
          encoded.append(ESCAPE_CHAR);
          break;
        default:
          // just append char
      }
      encoded.append(c);
    }
    return encoded.toString();
  }
217888
public function decryptValue($value)
    {
        $decoded = base64_decode($value);
        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
        $text = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->salt, $decoded, MCRYPT_MODE_ECB, $iv);

        return trim($text);
    }
1133466
public function decrypt($value)
    {
        $decoded = $this->url_decode($value);
        $iv = substr($decoded, 0, 16);
        $encryptedValue = str_replace($iv, '', $decoded);

        return trim(openssl_decrypt($encryptedValue, 'AES-256-CBC', $this->encryptionKey, null, $iv));
    }