protected XOREncryptionVerifier() { setEncryptedKey(new byte[2]); setEncryptedVerifier(new byte[2]); }
protected XOREncryptionVerifier(LittleEndianInput is) { /** * key (2 bytes): An unsigned integer that specifies the obfuscation key. * See [MS-OFFCRYPTO], 2.3.6.2 section, the first step of initializing XOR * array where it describes the generation of 16-bit XorKey value. */ byte key[] = new byte[2]; is.readFully(key); setEncryptedKey(key); /** * verificationBytes (2 bytes): An unsigned integer that specifies * the password verification identifier. */ byte verifier[] = new byte[2]; is.readFully(verifier); setEncryptedVerifier(verifier); }
@Override public void confirmPassword(String password) { int keyComp = CryptoFunctions.createXorKey1(password); int verifierComp = CryptoFunctions.createXorVerifier1(password); byte xorArray[] = CryptoFunctions.createXorArray1(password); byte shortBuf[] = new byte[2]; XOREncryptionVerifier ver = (XOREncryptionVerifier)getEncryptionInfo().getVerifier(); LittleEndian.putUShort(shortBuf, 0, keyComp); ver.setEncryptedKey(shortBuf); LittleEndian.putUShort(shortBuf, 0, verifierComp); ver.setEncryptedVerifier(shortBuf); setSecretKey(new SecretKeySpec(xorArray, "XOR")); }
protected XOREncryptionVerifier() { setEncryptedKey(new byte[2]); setEncryptedVerifier(new byte[2]); }
protected XOREncryptionVerifier(LittleEndianInput is) { /** * key (2 bytes): An unsigned integer that specifies the obfuscation key. * See [MS-OFFCRYPTO], 2.3.6.2 section, the first step of initializing XOR * array where it describes the generation of 16-bit XorKey value. */ byte key[] = new byte[2]; is.readFully(key); setEncryptedKey(key); /** * verificationBytes (2 bytes): An unsigned integer that specifies * the password verification identifier. */ byte verifier[] = new byte[2]; is.readFully(verifier); setEncryptedVerifier(verifier); }
@Override public void confirmPassword(String password) { int keyComp = CryptoFunctions.createXorKey1(password); int verifierComp = CryptoFunctions.createXorVerifier1(password); byte xorArray[] = CryptoFunctions.createXorArray1(password); byte shortBuf[] = new byte[2]; XOREncryptionVerifier ver = (XOREncryptionVerifier)getEncryptionInfo().getVerifier(); LittleEndian.putUShort(shortBuf, 0, keyComp); ver.setEncryptedKey(shortBuf); LittleEndian.putUShort(shortBuf, 0, verifierComp); ver.setEncryptedVerifier(shortBuf); setSecretKey(new SecretKeySpec(xorArray, "XOR")); }