~ruther/NosSmooth

ref: df935e1e2009a82faceb34d724356203459ef4ae NosSmooth/Core/NosSmooth.Cryptography/ICryptography.cs -rw-r--r-- 1.0 KiB
df935e1e — Rutherther fix(crypto): export session number correctly from encryption key 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
//  ICryptography.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Text;

namespace NosSmooth.Cryptography;

/// <summary>
/// An intefrace for NosTale cryptography, encryption, decryption of packets.
/// </summary>
public interface ICryptography
{
    /// <summary>
    /// Decrypt the raw packet (byte array) to a readable list string.
    /// </summary>
    /// <param name="str">Bytes to decrypt.</param>
    /// <param name="encoding">The encoding.</param>
    /// <returns>Decrypted packet to string list.</returns>
    string Decrypt(in ReadOnlySpan<byte> str, Encoding encoding);

    /// <summary>
    /// Encrypt the string packet to byte array.
    /// </summary>
    /// <param name="packet">String to encrypt.</param>
    /// <param name="encoding">The encoding.</param>
    /// <returns>Encrypted packet as byte array.</returns>
    byte[] Encrypt(string packet, Encoding encoding);
}
Do not follow this link