<commit_before># Encryption

Encryption package of the CodeCollab project

[![Build Status](https://travis-ci.org/CodeCollab/Encryption.svg?branch=master)](https://travis-ci.org/CodeCollab/Encryption) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](mit) [![Latest Stable Version](https://poser.pugx.org/codecollab/encryption/v/stable)](https://packagist.org/packages/codecollab/encryption) [![Total Downloads](https://poser.pugx.org/codecollab/encryption/downloads)](https://packagist.org/packages/codecollab/encryption) [![Latest Unstable Version](https://poser.pugx.org/codecollab/encryption/v/unstable)](https://packagist.org/packages/codecollab/encryption)

## Requirements

PHP7+

## Installation

Include the library in your project using composer:

    {
        "require-dev": {
            "codecollab/encryption": "1.0.*"
        }
    }

## Usage

This library provides a common interfaces and exceptions for handling crypto in your applications.

At the moment this library is just a wrapper around [defuse/php-encryption](https://github.com/defuse/php-encryption), but other crypto libraries will be included later.

### Generating key

Before being able to encrypt/decrypt data a key needs to be generated / added. To generate a new key use:

    $key = (new \CodeCollab\Encryption\Defuse\Key())->generate();
    
*Note: keys should always be stored in a secure location and should never be made public.*

### Encrypting

    $encryptedData = (new \CodeCollab\Encryption\Defuse\Encryptor($key))->encrypt('the data to encrypt');

### Decrypting

    $decryptedData = (new \CodeCollab\Encryption\Defuse\Decryptor($key))->decrypt($encryptedData);

## Contributing

[How to contribute][contributing]

## License

[MIT][mit]

[contributing]: https://github.com/CodeCollab/Encryption/blob/master/CONTRIBUTING.md
[mit]: http://spdx.org/licenses/MIT
<commit_msg>Added interfaces<commit_after># Encryption

Encryption package of the CodeCollab project

[![Build Status](https://travis-ci.org/CodeCollab/Encryption.svg?branch=master)](https://travis-ci.org/CodeCollab/Encryption) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](mit) [![Latest Stable Version](https://poser.pugx.org/codecollab/encryption/v/stable)](https://packagist.org/packages/codecollab/encryption) [![Total Downloads](https://poser.pugx.org/codecollab/encryption/downloads)](https://packagist.org/packages/codecollab/encryption) [![Latest Unstable Version](https://poser.pugx.org/codecollab/encryption/v/unstable)](https://packagist.org/packages/codecollab/encryption)

## Requirements

PHP7+

## Installation

Include the library in your project using composer:

    {
        "require-dev": {
            "codecollab/encryption": "1.0.*"
        }
    }

## Usage

This library provides a common interfaces and exceptions for handling crypto in your applications.

At the moment this library is just a wrapper around [defuse/php-encryption](https://github.com/defuse/php-encryption), but other crypto libraries will be included later.

### Generating key

Before being able to encrypt/decrypt data a key needs to be generated / added. To generate a new key use:

    $key = (new \CodeCollab\Encryption\Defuse\Key())->generate();
    
*Note: keys should always be stored in a secure location and should never be made public.*

*Note: all key share the common `CodeCollab\Encryption\Key` interface.*

### Encrypting

    $encryptedData = (new \CodeCollab\Encryption\Defuse\Encryptor($key))->encrypt('the data to encrypt');
    
*Note: all key share the common `CodeCollab\Encryption\Encryptor` interface.*

### Decrypting

    $decryptedData = (new \CodeCollab\Encryption\Defuse\Decryptor($key))->decrypt($encryptedData);
    
*Note: all key share the common `CodeCollab\Encryption\Decryptor` interface.*    

## Contributing

[How to contribute][contributing]

## License

[MIT][mit]

[contributing]: https://github.com/CodeCollab/Encryption/blob/master/CONTRIBUTING.md
[mit]: http://spdx.org/licenses/MIT

{'fraction_non_alphanumeric': 0.13774241670810541, 'fraction_numerical': 0.0014917951268025858, 'mean_word_length': 4.666197183098592, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4344173', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1246, 'n_words': 283}