<commit_before># libgdx-crypt-texture
A simple library to encrypt and decrypt files (include libGdx Texture)

# Usage
## Encryption
The class `TextureEncryptor` should be used in dev PC only.  
You can build this project into executable jar file, then run on command line to encrypt files.  
Command line arguments:
  - <key>       (required) key to encrypt (0-255)
  - <input>     (required) input file/folder
  - [output]    (optional) output folder
This executable currently uses `SimpleXorCrypto` algorithm.

## Decryption
Use class `TextureDecryptor` to decrypt file, passing your specific crypto implementation.  
```
// Your secret key to encrypt
int secretKey = 123;

// Use simple crypto implementation
Crypto crypto = new SimpleXorCrypto((byte) secretKey);

// Decrypt texture file
Texture decrypted = TextureDecryptor.loadTexture(crypto, "encrypted_texture_file.png");
```

## Crypto<commit_msg>Add usage steps to README<commit_after># libgdx-crypt-texture
A simple library to encrypt and decrypt files (include libGdx Texture)

# Usage
Step 1. Use other tools to create texture file (e.g. [TexturePacker](https://github.com/crashinvaders/gdx-texture-packer-gui))  
Step 2. Encrypt generated texture files by `libgdx-crypt-texture` executable jar.  
Step 3. In libGdx project source code:
  - If you use `Texture`, decrypting by `TextureDecryptor`
  - If you want to load texture to skin, use `CryptSkin`

## Encryption
The class `TextureEncryptor` should be used in dev PC only.  
You can build this project into executable jar file, then run on command line to encrypt files.  
Command line arguments:
  - key (required) : key to encrypt (0-255)
  - input (required) : input file/folder
  - output (optional) : output folder
This executable currently uses `SimpleXorCrypto` algorithm.

## Decryption
Use class `TextureDecryptor` to decrypt file, passing your specific crypto implementation.  
```
// Your secret key to encrypt
int secretKey = 123;

// Use simple crypto implementation
Crypto crypto = new SimpleXorCrypto((byte) secretKey);

// Decrypt texture file
Texture decrypted = TextureDecryptor.loadTexture(crypto, "encrypted_texture_file.png");
```

## Crypto
{'fraction_non_alphanumeric': 0.08486238532110092, 'fraction_numerical': 0.007798165137614679, 'mean_word_length': 4.466165413533835, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3241212', 'n_tokens_mistral': 652, 'n_tokens_neox': 615, 'n_words': 252}