• Home
  • Tutorials
  • API Documentation
  • Asset Store
Show / Hide Table of Contents
  • SuperNet.Netcode.Compress
    • CompressorDeflate
    • CompressorLZF
    • ICompressor
  • SuperNet.Netcode.Crypto
    • CryptoAES
    • CryptoECDH
    • CryptoRandom
    • CryptoRSA
    • Curve25519
    • ICryptoAuthenticator
    • ICryptoEncryptor
    • ICryptoExchanger
    • ICryptoRandom
  • SuperNet.Netcode.Transport
    • ConnectionRequest
    • DisconnectReason
    • Host
    • HostConfig
    • HostEvents
    • HostStatistics
    • HostTimespan
    • HostTimestamp
    • IHostListener
    • IMessage
    • IMessageListener
    • IPeerListener
    • MessageEvents
    • MessageReceived
    • MessageSent
    • Peer
    • PeerConfig
    • PeerEvents
    • PeerStatistics
  • SuperNet.Netcode.Util
    • Allocator
    • ArrayPool<T>
    • CRC32
    • IPComparer
    • IPResolver
    • IWritable
    • ObjectPool<T>
    • Reader
    • Serializer
    • Writer
  • SuperNet.Unity.Components
    • INetworkAuthoritative
    • INetworkRegisterable
    • INetworkRollbackable
    • NetworkAnimation
    • NetworkAnimator
    • NetworkAuthority
    • NetworkPrefab
    • NetworkRegistrar
    • NetworkSpawner
    • NetworkSyncModeMethod
    • NetworkSyncModeVector2
    • NetworkSyncModeVector3
    • NetworkTransform
  • SuperNet.Unity.Core
    • NetworkComponent
    • NetworkHost
    • NetworkIdentity
    • NetworkIdentityExtensions
    • NetworkManager
  • SuperNet.Unity.Editor
    • NetworkAuthorityEditor
    • NetworkHostEditor
    • NetworkHostEditor.BandwithUnit
    • NetworkIdentityDrawer
    • NetworkManagerEditor
    • NetworkPrefabEditor
    • NetworkSpawnerEditor

Class CryptoAES

Encryptor based on 256-bit Advanced Encryption Standard (AES).

Inheritance
System.Object
CryptoAES
Implements
ICryptoEncryptor
IDisposable
Namespace: SuperNet.Netcode.Crypto
Assembly: cs.temp.dll.dll
Syntax
public sealed class CryptoAES : ICryptoEncryptor, IDisposable

Constructors

CryptoAES(Byte[], Allocator)

Create a new AES encryptor with the provided key.

Declaration
public CryptoAES(byte[] key, Allocator allocator)
Parameters
Type Name Description
System.Byte[] key

Encryption key to use.

Allocator allocator

Allocator to use for allocating keys.

Methods

Decrypt(ArraySegment<Byte>, Byte[], Int32)

Decrypt data.

Declaration
public int Decrypt(ArraySegment<byte> input, byte[] output, int offset)
Parameters
Type Name Description
ArraySegment<System.Byte> input

Array segment to decrypt.

System.Byte[] output

Output buffer to write to.

System.Int32 offset

Output offset to write to.

Returns
Type Description
System.Int32

Total number of bytes written to the output.

Dispose()

Instantly dispose of all resources.

Declaration
public void Dispose()

Encrypt(ArraySegment<Byte>, Byte[], Int32)

Encrypt data.

Declaration
public int Encrypt(ArraySegment<byte> input, byte[] output, int offset)
Parameters
Type Name Description
ArraySegment<System.Byte> input

Array segment to encrypt.

System.Byte[] output

Output buffer to write to.

System.Int32 offset

Output offset to write to.

Returns
Type Description
System.Int32

Total number of bytes written to the output.

MaxDecryptedLength(Int32)

Compute the maximum decrypted length before decrypting.

Declaration
public int MaxDecryptedLength(int inputLength)
Parameters
Type Name Description
System.Int32 inputLength

Length of the input that is about to be decrypted.

Returns
Type Description
System.Int32

Maximum possible decrypted length.

MaxEncryptedLength(Int32)

Compute the maximum encrypted length before encrypting.

Declaration
public int MaxEncryptedLength(int inputLength)
Parameters
Type Name Description
System.Int32 inputLength

Length of the input that is about to be encrypted.

Returns
Type Description
System.Int32

Maximum possible encrypted length.

Implements

ICryptoEncryptor
IDisposable
Back to top Generated by DocFX