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

游戲存檔加密

發布時間: 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;

}

}

熱點內容
matlab編寫演算法 發布:2025-07-01 22:24:47 瀏覽:729
自己電腦做當伺服器 發布:2025-07-01 22:24:28 瀏覽:179
輸入存儲器 發布:2025-07-01 22:23:39 瀏覽:425
android源碼網盤下載 發布:2025-07-01 22:19:45 瀏覽:64
有解壓軟體 發布:2025-07-01 22:14:31 瀏覽:236
php輸出txt 發布:2025-07-01 22:05:21 瀏覽:707
為什麼有的銀行卡密碼鎖不上 發布:2025-07-01 22:04:31 瀏覽:338
甘蔗苗存儲 發布:2025-07-01 21:47:03 瀏覽:665
選定文件夾 發布:2025-07-01 21:45:14 瀏覽:232
資料庫或且 發布:2025-07-01 21:40:54 瀏覽:1000