<commit_before># NewHope_X25519_XSalsa20_Poly1305
Post Quantum key exchange with NewHope and NaCl (requires Python3.6)
<hr>
(For the love of everything holy please do not use this yet. This is the very first version and many things will change.)<br>
The NewHope_X25519_XSalsa20_Poly1305 exchange class is found in the nhxpoly/ folderr.<br>
<br>
If NewHope turns out to be breakable, you will at least still have the same security X25519_XSalsa20_Poly1305 offers.<br>
Both algorithms need to be broken in order for the original exchange key to be reconstructed.<br>
Combining this key exchange with more public key algos will offer that much more security because then X amount of algos will have to be broken.<br>
With the resulting secret key from the exchange you may treat it as a OTP key and utilize the Vernam Cipher and exchange a new key per message.<br>
You can also use it to generate a AES-256 key. Recommendeded cipher modes would be CTR or GCM.<br><br>

<h1>Description</h1><br>
This library aims to combine the post-quantum NewHope encryption and X25519 elliptical curve cryptography.<br>
The key exchange takes place over two seperate encryption algorithms SIMILIAR but different to Google's CECPQ1 protocol using in Chrome Canary.<br>
First a random 32 byte key chunk is created by the software initiating the key exchange.<br>
The sender who wants to create the encrypted channels then creates a X25519_XSalsa20_Poly1305 key pair and sends it the exchange requester.<br>
The exchange requester encrypts the first 32 byte chunk and sends it back to the sender.<br>
This concludes the first half of the key exchange.<br> 
The requester then begins a commitment protocol which is essentially a way to verify that an eavesdropper isn't tampering with the NewHope key exchange.<br>
The sender sends a random shake_128 hashed seed to the requester.<br>
The requester stores this, then sends the requester their own unhashed seed.<br>
The sender then sends their unhashed seed and first sequence of the NewHope Basepoint.<br>
The requester verifies the seed matches the shake_128 hash.<br>
If so a the requester sends their NewHope Basepoint and an authentice NewHope Key exchange has taken place.<br>
Both the sender and requester can now generate their shared secret key.<br>
Both then combine the two shared key chunks to form a prekey.<br>
This key can now be used to start some sort of encrypted channel of the users choice.<br> 
 
Here is output from a test use of the protocol in example.py<br>
```<commit_msg>README update again<commit_after># NewHope_X25519_XSalsa20_Poly1305
Post Quantum key exchange with NewHope and NaCl (requires Python3.6)
<hr>
(For the love of everything holy please do not use this yet. This is the very first version and many things will change.)<br><br>
The NewHope_X25519_XSalsa20_Poly1305 exchange class is found in the nhxpoly/ folder.<br>
<br>
If NewHope turns out to be breakable, you will at least still have the same security X25519_XSalsa20_Poly1305 offers.<br>
Both algorithms need to be broken in order for the original exchange key to be reconstructed.<br>
Combining this key exchange with more public key algos will offer that much more security because then X amount of algos will have to be broken.<br>
With the resulting secret key from the exchange you may treat it as a OTP key and utilize the Vernam Cipher and exchange a new key per message.<br>
You can also use it to generate a AES-256 key. Recommendeded cipher modes would be CTR or GCM.<br>
It would also be wise to utilize some sort of hashing method per encrypted message to verify it hasn't been tampered with.<br><br>

<h1>Description</h1><br>
This library aims to combine the post-quantum NewHope encryption and X25519 elliptical curve cryptography.<br>
The key exchange takes place over two seperate encryption algorithms SIMILIAR but different to Google's CECPQ1 protocol using in Chrome Canary.<br>
First a random 32 byte key chunk is created by the software initiating the key exchange.<br>
The sender who wants to create the encrypted channels then creates a X25519_XSalsa20_Poly1305 key pair and sends it the exchange requester.<br>
The exchange requester encrypts the first 32 byte chunk and sends it back to the sender.<br>
This concludes the first half of the key exchange.<br> 
The requester then begins a commitment protocol which is essentially a way to verify that an eavesdropper isn't tampering with the NewHope key exchange.<br>
The sender sends a random shake_128 hashed seed to the requester.<br>
The requester stores this, then sends the requester their own unhashed seed.<br>
The sender then sends their unhashed seed and first sequence of the NewHope Basepoint.<br>
The requester verifies the seed matches the shake_128 hash.<br>
If so a the requester sends their NewHope Basepoint and an authentice NewHope Key exchange has taken place.<br>
Both the sender and requester can now generate their shared secret key.<br>
Both then combine the two shared key chunks to form a prekey.<br>
This key can now be used to start some sort of encrypted channel of the users choice.<br> 
 
Here is output from a test use of the protocol in example.py<br>
```
{'fraction_non_alphanumeric': 0.040863531225905934, 'fraction_numerical': 0.025828835774865073, 'mean_word_length': 4.896590909090909, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 63, 'https://': 0, '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': '1805105', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1317, 'n_words': 808}