Use it instead of regular string for any cheating-sensitive variables.
More...
|
|
void | ApplyNewCryptoKey () |
| | Use it after SetNewCryptoKey() to re-encrypt current instance using new crypto key.
|
| |
| void | RandomizeCryptoKey () |
| | Allows to change current crypto key to the new random value and re-encrypt variable using it. Use it for extra protection against 'unknown value' search. Just call it sometimes when your variable doesn't change to fool the cheater.
|
| |
| string | GetEncrypted () |
| | Allows to pick current obscured value as is.
|
| |
| void | SetEncrypted (string encrypted) |
| | Allows to explicitly set current obscured value. Crypto key should be same as when encrypted value was got with GetEncrypted().
|
| |
| string | GetDecrypted () |
| | Alternative to the type cast, use if you wish to get decrypted value but can't or don't want to use cast to the regular type.
|
| |
|
|
static void | SetNewCryptoKey (string newKey) |
| | Allows to change default crypto key of this type instances. All new instances will use specified key.
All current instances will use previous key unless you call ApplyNewCryptoKey() on them explicitly.
|
| |
| static string | EncryptDecrypt (string value) |
| | Simple symmetric encryption, uses default crypto key.
|
| |
| static string | EncryptDecrypt (string value, string key) |
| | Simple symmetric encryption, uses passed crypto key.
|
| |
| static ObscuredString | FromEncrypted (string encrypted) |
| | Creates and fills obscured variable with raw encrypted value previously got from GetEncrypted().
|
| |
Use it instead of regular string for any cheating-sensitive variables.
Regular type is faster and memory wiser comparing to the obscured one!
◆ EncryptDecrypt() [1/2]
| static string CodeStage.AntiCheat.ObscuredTypes.ObscuredString.EncryptDecrypt |
( |
string |
value | ) |
|
|
inlinestatic |
Simple symmetric encryption, uses default crypto key.
- Returns
- Encrypted or decrypted
string (depending on what string was passed to the function)
◆ EncryptDecrypt() [2/2]
| static string CodeStage.AntiCheat.ObscuredTypes.ObscuredString.EncryptDecrypt |
( |
string |
value, |
|
|
string |
key |
|
) |
| |
|
inlinestatic |
Simple symmetric encryption, uses passed crypto key.
- Returns
- Encrypted or decrypted
string (depending on what string was passed to the function)
◆ FromEncrypted()
| static ObscuredString CodeStage.AntiCheat.ObscuredTypes.ObscuredString.FromEncrypted |
( |
string |
encrypted | ) |
|
|
inlinestatic |
Creates and fills obscured variable with raw encrypted value previously got from GetEncrypted().
Literally does same job as SetEncrypted() but makes new instance instead of filling existing one, making it easier to initialize new variables from saved encrypted values.
Make sure this obscured type currently has same crypto key as when encrypted value was got with GetEncrypted(). It will be same (default) if you did not used SetNewCryptoKey().
- Parameters
-
| encrypted | Raw encrypted value you got from GetEncrypted(). |
- Returns
- New obscured variable initialized from specified encrypted value.
- See also
- GetEncrypted(), SetEncrypted()
◆ GetDecrypted()
| string CodeStage.AntiCheat.ObscuredTypes.ObscuredString.GetDecrypted |
( |
| ) |
|
|
inline |
Alternative to the type cast, use if you wish to get decrypted value but can't or don't want to use cast to the regular type.
- Returns
- Decrypted value.
◆ GetEncrypted()
| string CodeStage.AntiCheat.ObscuredTypes.ObscuredString.GetEncrypted |
( |
| ) |
|
|
inline |
Allows to pick current obscured value as is.
Use it in conjunction with SetEncrypted().
Useful for saving data in obscured state.
◆ RandomizeCryptoKey()
| void CodeStage.AntiCheat.ObscuredTypes.ObscuredString.RandomizeCryptoKey |
( |
| ) |
|
|
inline |
Allows to change current crypto key to the new random value and re-encrypt variable using it. Use it for extra protection against 'unknown value' search. Just call it sometimes when your variable doesn't change to fool the cheater.
WARNING: produces some garbage, be careful when using it!
◆ SetEncrypted()
| void CodeStage.AntiCheat.ObscuredTypes.ObscuredString.SetEncrypted |
( |
string |
encrypted | ) |
|
|
inline |
Allows to explicitly set current obscured value. Crypto key should be same as when encrypted value was got with GetEncrypted().
Use it in conjunction with GetEncrypted().
Useful for loading data stored in obscured state.
- See also
- FromEncrypted()
The documentation for this class was generated from the following file:
- C:/Transhuman/S2/Assets/Plugins/Teal-Net/Plugins/CodeStage/AntiCheatToolkit/Runtime/Scripts/ObscuredTypes/ObscuredString.cs