My Project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
CodeStage.AntiCheat.ObscuredTypes.ObscuredULong Struct Reference

Use it instead of regular ulong for any cheating-sensitive variables. More...

Inheritance diagram for CodeStage.AntiCheat.ObscuredTypes.ObscuredULong:

Public Member Functions

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.
 
ulong GetEncrypted ()
 Allows to pick current obscured value as is.
 
void SetEncrypted (ulong encrypted)
 Allows to explicitly set current obscured value. Crypto key should be same as when encrypted value was got with GetEncrypted().
 
ulong 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 Public Member Functions

static void SetNewCryptoKey (ulong 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 ulong Encrypt (ulong value)
 Simple symmetric encryption, uses default crypto key.
 
static ulong Decrypt (ulong value)
 Simple symmetric encryption, uses default crypto key.
 
static ulong Encrypt (ulong value, ulong key)
 Simple symmetric encryption, uses passed crypto key.
 
static ulong Decrypt (ulong value, ulong key)
 Simple symmetric encryption, uses passed crypto key.
 
static ObscuredULong FromEncrypted (ulong encrypted)
 Creates and fills obscured variable with raw encrypted value previously got from GetEncrypted().
 

Detailed Description

Use it instead of regular ulong for any cheating-sensitive variables.

Regular type is faster and memory wiser comparing to the obscured one!

Member Function Documentation

◆ Decrypt() [1/2]

static ulong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.Decrypt ( ulong  value)
inlinestatic

Simple symmetric encryption, uses default crypto key.

Returns
Decrypted ulong.

◆ Decrypt() [2/2]

static ulong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.Decrypt ( ulong  value,
ulong  key 
)
inlinestatic

Simple symmetric encryption, uses passed crypto key.

Returns
Decrypted ulong.

◆ Encrypt() [1/2]

static ulong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.Encrypt ( ulong  value)
inlinestatic

Simple symmetric encryption, uses default crypto key.

Returns
Encrypted ulong.

◆ Encrypt() [2/2]

static ulong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.Encrypt ( ulong  value,
ulong  key 
)
inlinestatic

Simple symmetric encryption, uses passed crypto key.

Returns
Encrypted ulong.

◆ FromEncrypted()

static ObscuredULong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.FromEncrypted ( ulong  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
encryptedRaw encrypted value you got from GetEncrypted().
Returns
New obscured variable initialized from specified encrypted value.
See also
GetEncrypted(), SetEncrypted()

◆ GetDecrypted()

ulong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.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()

ulong CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.GetEncrypted ( )
inline

Allows to pick current obscured value as is.

Use it in conjunction with SetEncrypted().
Useful for saving data in obscured state.

◆ SetEncrypted()

void CodeStage.AntiCheat.ObscuredTypes.ObscuredULong.SetEncrypted ( ulong  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 struct was generated from the following file: