Skip to content

Secured Files

TinyPlay edited this page Nov 21, 2021 · 1 revision

Secured Files Class

This class provides secure (encrypted access) to read and write data. It can be useful for saving game data or for writing/reading entire objects using popular encryption methods.

Currently available encryption and hashing methods are:
AES, RSA, Base64, MD5, SHA, xxHash

API Reference

For SecuredFile.cs:

Method Params Returns Usage
UpdateEncryptionKey string key - Update Current Encryption Key for SecuredFile Class
GetEnryptionKey - string key Return Current Encryption Key
ReadFile string path
Encoding encoding = null
string result Read text file with Encoding
ReadEncryptedFile string path
FileEncryptionType encryptionType = FileEncryptionType.Base64
Encoding encoding = null
string result Read and Decrypt text file
ReadBinary string path byte[] result Read Binary File
ReadEncryptedBinary string path
FileEncryptionType encryptionType = FileEncryptionType.AES
byte[] result Read and Decrypt bynary File
ReadFileFromResources string resource string result Read text file from resources
ReadEncryptedFileFromResources string resource
FileEncryptionType encryptionType = FileEncryptionType.Base64
string result Read and Decrypt Text File from Resources
ReadBinaryFromResources string resource byte[] result Read Binary File from Resources
ReadEncryptedBinaryFromResources string resource
FileEncryptionType encryptionType = FileEncryptionType.AES
byte[] result Read and Decrypt Binary File From Resources
SaveFile string path
string content
Encoding encoding = null
- Save text file with Encoding
SaveEncryptedFile string path
string content
FileEncryptionType encryptionType = FileEncryptionType.Base64
Encoding encoding = null
- Encrypt and Save text file with encoding to path
SaveBinary string path
byte[] content
- Save bytes array to binary file
SaveEncryptedBinary string path
byte[] content
FileEncryptionType encryptionType = FileEncryptionType.AES
- Encode bytes array and save to binary data
CopyFile string originalFilePath
string destinationFilePath
bool overwrite = false
- Copy File to Destination
RemoveFile string path - Remove File from path

Navigation

Base Classes and Types:

Additional Classes and Types:

Encryption Classes:

Download Latest Release

Don't forget to install latest Pixel Anti-Cheat Release:
https://github.com/TinyPlay/Pixel-Anticheat/releases

Contacts

The developers of the library:
https://github.com/TinyPlay

Pixe Incubator Discord:
https://discord.com/invite/Ee9sYsttWP

VK Community:
https://vk.com/pixelincubator

Clone this wiki locally