byte[] keyHardware = OSUtils.getHardwareID();
try {
Cipher aes = Cipher.getInstance("AES");
if (keyHardware != null && keyHardware.length > 0) {
aes.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(pad(keyHardware), "AES"));
return Base64.encodeBase64String(aes.doFinal(("FDT:" + str).getBytes("utf8")));
}
aes.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(pad(keyMac), "AES"));
return Base64.encodeBase64String(aes.doFinal(("FDT:" + str).getBytes("utf8")));
} catch (Exception e) {
Logger.logError("Error Encrypting information, reverting to legacy format", e);