public void writeUserPassword(byte[] plaintext, String password) throws IOException {
dos.writeByte(USER_PASSWORD);
byte[] salt = CryptoUtils.generateSecureRandom(16);
CryptoKey derivedKey = FathomdbCrypto.deriveKey(salt, password);
byte[] encrypted = FathomdbCrypto.encrypt(derivedKey, plaintext);
// writeEncoded(dos, userId);
writeArray(dos, salt);
writeArray(dos, encrypted);