Log if there is no encryption keys

This commit is contained in:
2025-07-08 22:11:02 -07:00
parent 5e3be9293a
commit 599b0fa545

View File

@@ -13,7 +13,11 @@ public class SensitiveInfo
public static string Encrypt(string plainText, string key) public static string Encrypt(string plainText, string key)
{ {
if (SERVER_RECEIVE_TRANSFER_KEY.Trim() == string.Empty || SERVER_SEND_TRANSFER_KEY.Trim() == string.Empty) return null; if (SERVER_RECEIVE_TRANSFER_KEY.Trim() == string.Empty || SERVER_SEND_TRANSFER_KEY.Trim() == string.Empty)
{
Debug.LogError("Failed to encrypt: Encryption/Decryption keys not present");
return null;
}
try try
{ {
using Aes aes = Aes.Create(); using Aes aes = Aes.Create();
@@ -42,7 +46,11 @@ public class SensitiveInfo
public static byte[] EncryptRaw(string text, string key) public static byte[] EncryptRaw(string text, string key)
{ {
if (SERVER_RECEIVE_TRANSFER_KEY.Trim() == string.Empty || SERVER_SEND_TRANSFER_KEY.Trim() == string.Empty) return null; if (BAZOOKA_MANAGER_KEY.Trim() == string.Empty)
{
Debug.LogError("Failed to encrypt: Encryption/Decryption keys not present");
return null;
}
try try
{ {
using Aes aes = Aes.Create(); using Aes aes = Aes.Create();
@@ -73,6 +81,7 @@ public class SensitiveInfo
{ {
if (SERVER_RECEIVE_TRANSFER_KEY.Trim() == string.Empty || SERVER_SEND_TRANSFER_KEY.Trim() == string.Empty) if (SERVER_RECEIVE_TRANSFER_KEY.Trim() == string.Empty || SERVER_SEND_TRANSFER_KEY.Trim() == string.Empty)
{ {
Debug.LogError("Failed to decrypt: Encryption/Decryption keys not present");
return "-996"; return "-996";
} }
try try
@@ -104,6 +113,7 @@ public class SensitiveInfo
{ {
if (BAZOOKA_MANAGER_KEY.Trim() == string.Empty) if (BAZOOKA_MANAGER_KEY.Trim() == string.Empty)
{ {
Debug.LogError("Failed to decrypt: Encryption/Decryption keys not present");
return null; return null;
} }
try try