if (entry.hasVersion()) {
version = entry.getVersion();
}
CryptoKey v0;
AesKey v1;
if (version == 0) {
AesCbcCryptoKey passwordKey = AesCbcCryptoKey.deriveKey(entry.getIterations(), entry.getSeed()
.toByteArray(), password);
byte[] plaintext = FathomdbCrypto.decrypt(passwordKey, entry.getCiphertext().toByteArray());
v0 = FathomdbCrypto.deserializeKey(plaintext);
HmacKey hmacKey = KeyczarUtils.deriveHmac(plaintext, entry.getSeed().toByteArray(), password);
v1 = new AesKey(((AesCbcCryptoKey) v0).getJce().getEncoded(), hmacKey);
} else if (version == 1) {
AesKey passwordKey = KeyczarUtils.deriveKey(entry.getIterations(), entry.getSeed().toByteArray(),
password);
byte[] plaintext = KeyczarUtils.decrypt(passwordKey, entry.getCiphertext().toByteArray());
v1 = KeyczarUtils.unpack(plaintext);