public byte[] decryptPayload(String passphrase) throws IOException {
		
		String dekInfo = (String) header.get("DEK-Info");

		if (dekInfo != null) {
			int comma = dekInfo.indexOf(',');
			String keyAlgorithm = dekInfo.substring(0, comma);

			if (!"DES-EDE3-CBC".equalsIgnoreCase(keyAlgorithm)
					&& !"AES-128-CBC".equalsIgnoreCase(keyAlgorithm)) {
				throw new IOException("Unsupported passphrase algorithm: "
						+ keyAlgorithm);
			}

			String ivString = dekInfo.substring(comma + 1);
			byte[] iv = new byte[ivString.length() / 2];

			for (int i = 0; i < ivString.length(); i += 2) {
				iv[i / 2] = (byte) Integer.parseInt(
						ivString.substring(i, i + 2), 16);
			}

			byte[] keydata = null;
			SshCipher cipher = null;

			if ("DES-EDE3-CBC".equalsIgnoreCase(keyAlgorithm)) {
				keydata = getKeyFromPassphrase(passphrase, iv, 24);
				cipher = new TripleDesCbc();
			} else if ("AES-128-CBC".equalsIgnoreCase(keyAlgorithm)) {
				keydata = getKeyFromPassphrase(passphrase, iv, 16);
				cipher = new AES128Cbc();
			}

			cipher.init(SshCipher.DECRYPT_MODE, iv, keydata);

			byte[] plain = new byte[payload.length];
			cipher.transform(payload, 0, plain, 0, plain.length);

			return plain;
		}
		return payload;
		
	}
public byte [ ] decryptPayload ( String passphrase ) throws IOException { String dekInfo = ( String ) header . get ( "DEK-Info" ) ; if ( dekInfo != null ) { int comma = dekInfo . indexOf ( ',' ) ; String keyAlgorithm = dekInfo . substring ( 0 , comma ) ; if ( ! "DES-EDE3-CBC" . equalsIgnoreCase ( keyAlgorithm ) && ! "AES-128-CBC" . equalsIgnoreCase ( keyAlgorithm ) ) { throw new IOException ( "Unsupported passphrase algorithm: " + keyAlgorithm ) ; } String ivString = dekInfo . substring ( comma + 1 ) ; byte [ ] iv = new byte [ ivString . length ( ) / 2 ] ; for ( int i = 0 ; i < ivString . length ( ) ; i += 2 ) { iv [ i / 2 ] = ( byte ) Integer . parseInt ( ivString . substring ( i , i + 2 ) , 16 ) ; } byte [ ] keydata = null ; SshCipher cipher = null ; if ( "DES-EDE3-CBC" . equalsIgnoreCase ( keyAlgorithm ) ) { keydata = getKeyFromPassphrase ( passphrase , iv , 24 ) ; cipher = new TripleDesCbc ( ) ; } else if ( "AES-128-CBC" . equalsIgnoreCase ( keyAlgorithm ) ) { keydata = getKeyFromPassphrase ( passphrase , iv , 16 ) ; cipher = new AES128Cbc ( ) ; } cipher . init ( SshCipher . DECRYPT_MODE , iv , keydata ) ; byte [ ] plain = new byte [ payload . length ] ; cipher . transform ( payload , 0 , plain , 0 , plain . length ) ; return plain ; } return payload ; }
@param passphrase

@return byte[]