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

游戲存檔加密

發布時間: 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-07-01 11:14:34 瀏覽:123
css3源碼 發布:2025-07-01 11:14:33 瀏覽:330
android訪問本機 發布:2025-07-01 10:56:06 瀏覽:412
伺服器改id是什麼 發布:2025-07-01 10:30:03 瀏覽:612
php微信開發教程 發布:2025-07-01 10:28:24 瀏覽:843
訪問學者聯系導師 發布:2025-07-01 10:27:44 瀏覽:985
伺服器端的http地址 發布:2025-07-01 10:04:35 瀏覽:177
php好處 發布:2025-07-01 10:01:45 瀏覽:879
安卓車機什麼屏幕好 發布:2025-07-01 09:46:15 瀏覽:549
編譯原理re不能描述的串 發布:2025-07-01 09:34:24 瀏覽:76