當前位置:首頁 » 密碼管理 » 游戲存檔加密

游戲存檔加密

發布時間: 2023-09-11 04:23:55

1. 橙光怎麼設置存檔位上鎖

存檔則悉上鎖在存檔設置裡面,自己設置一下加密就好。
橙光游戲存檔方法:點擊「緣起」進入游戲點右下角的蓮花出現四個選擇條,點擊記憶然後按一下就變成下面的樣子了並握點擊返回,下回玩的時候點擊「讀取」把絕盯慶那個框條按一下就可以載入了。
所謂橙光游戲指的是使用橙光文字游戲製作工具所製作出來的文字游戲,玩家在游戲中可以攻略男主或女主,可以統領後宮,可以仗劍江湖,可以完成夢想,可以與喜歡的明星朝夕相處。利用橙光文字游戲製作工具可以輕松製作出自己的橙光游戲。

2. 如何在 unity3D 游戲存檔加密

存檔文件, 被修改起來現在變的很容易了, 為了解決這個問題,請用下面的代碼,修改playerPrefs.cs

1.替換

fileReader = new StreamReader(fileName);

serializedInput =DecryptDES(fileReader.ReadLine(), highscore.keyss);
復制代碼

2.替換

fileWriter.WriteLine( EncryptDES(serializedOutput , highscore.keyss));

fileWriter.Close();
復制代碼

3.

//默認密鑰向量

private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };public static string keyss = "1234567z";

/// <summary>

/// DES加密字元串

/// </summary>

/// <param name="encryptString">待加密的字元串</param>

/// <param name="encryptKey">加密密鑰,要求為8位</param>

/// <returns>加密成功返回加密後的字元串,失敗返回源串</returns>

public static string EncryptDES(string encryptString, string encryptKey)

{

try

{

byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8));

byte[] rgbIV = Keys;

byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString);

DESCryptoServiceProvider dCSP = new DESCryptoServiceProvider();

MemoryStream mStream = new MemoryStream();

CryptoStream cStream = new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write);

cStream.Write(inputByteArray, 0, inputByteArray.Length);

cStream.FlushFinalBlock();

return Convert.ToBase64String(mStream.ToArray());

}

catch

{

return encryptString;

}

}/// <summary>

/// DES解密字元串

/// </summary>

/// <param name="decryptString">待解密的字元串</param>

/// <param name="decryptKey">解密密鑰,要求為8位,和加密密鑰相同</param>

/// <returns>解密成功返回解密後的字元串,失敗返源串</returns>

public static string DecryptDES(string decryptString, string decryptKey)

{

try

{

byte[] rgbKey = Encoding.UTF8.GetBytes(decryptKey);

byte[] rgbIV = Keys;

byte[] inputByteArray = Convert.FromBase64String(decryptString);

DESCryptoServiceProvider DCSP = new DESCryptoServiceProvider();

MemoryStream mStream = new MemoryStream();

CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write);

cStream.Write(inputByteArray, 0, inputByteArray.Length);

cStream.FlushFinalBlock();

return Encoding.UTF8.GetString(mStream.ToArray());

}

catch

{

return decryptString;

}

}

熱點內容
金蝶電腦伺服器在哪裡 發布:2025-10-15 02:47:25 瀏覽:116
雙線伺服器一個ip有什麼區別 發布:2025-10-15 02:35:14 瀏覽:757
php的類定義 發布:2025-10-15 02:27:46 瀏覽:505
編譯技術都是什麼 發布:2025-10-15 02:27:10 瀏覽:766
android卡片效果圖 發布:2025-10-15 02:26:18 瀏覽:686
申請郵箱密碼是什麼 發布:2025-10-15 02:23:15 瀏覽:546
Python轉換整形 發布:2025-10-15 02:18:32 瀏覽:794
維綸EBpro反編譯 發布:2025-10-15 02:10:42 瀏覽:85
軸承查詢源碼 發布:2025-10-15 01:58:24 瀏覽:795
linux系統里檢查ftp狀態 發布:2025-10-15 01:52:41 瀏覽:239