/*
- * Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2018-2019 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
*
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.Arrays;
secureRandom.nextBytes(saltByteArray);
// Convert the encryption password to a byte array.
- byte[] encryptionPasswordByteArray = encryptionPasswordString.getBytes("UTF-8");
+ byte[] encryptionPasswordByteArray = encryptionPasswordString.getBytes(StandardCharsets.UTF_8);
// Append the salt to the encryption password byte array. This protects against rainbow table attacks.
byte[] encryptionPasswordWithSaltByteArray = new byte[encryptionPasswordByteArray.length + saltByteArray.length];
encryptedImportFileInputStream.read(initializationVector);
// Convert the encryption password to a byte array.
- byte[] encryptionPasswordByteArray = encryptionPasswordString.getBytes("UTF-8");
+ byte[] encryptionPasswordByteArray = encryptionPasswordString.getBytes(StandardCharsets.UTF_8);
// Append the salt to the encryption password byte array. This protects against rainbow table attacks.
byte[] encryptionPasswordWithSaltByteArray = new byte[encryptionPasswordByteArray.length + saltByteArray.length];