protected static byte[] decodeData(String password, BufferedImage origin, BufferedImage otp) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException {
        byte[] otpA = null;
        if (otp != null) {
            otpA = IDEImage.readOtp(otp);
        }
        byte[] allData = IDEImage.readData(origin, otpA);
        int saltLength = allData[0];
        if (saltLength < 0) {
            saltLength += 256;
        }
        byte[] saltBytes = new byte[saltLength];
        for (int i = 1; i <= saltLength; i++) {
            saltBytes[i - 1] = allData[i];
        }
        String salt = new String(saltBytes, "UTF-8");
        IDEKeyData key = IDEKeyFactory.generateKeyKnownSalt(password, salt);
        byte[] data = new byte[allData.length - saltLength - 1];
        for (int i = (saltLength + 1); i < allData.length; i++) {
            data[i - (saltLength + 1)] = allData[i];
        }
        byte[] decodedData = EncryptionFactory.decode(data, key.getKeyData());
        return decodedData;
    }