Closed vzool closed 7 years ago
Not 100% sure what you're saying.
You've used another library to generate keys for this library and they're not compatible?
A quick look at their Key
class, keys are constructed with raw bytes, and have a getRawBytes()
method.
Unsure what "rules" you are referring to, there is nothing inherently insecure about the keys generated with 32 bytes from random_bytes
as I recommend in the README. Keys passed to the library are properly clamped per the reference implementation.
There are many rules existed in their Encoding class that used to import/export keys:
-------------------------------------
| Binary Key Structure |
|------------------------------------|
| header | bytes | hashing |
|------------------------------------|
------------------------------------
| Hashing Structure |
|-----------------------------------|
| algo | header | bytes |
|-----------------------------------|
As they have use a hash_hmac while encrypting and decrypting data.
-------------------------------------
| Encrypted Data Structure |
|------------------------------------|
| ciphertext | AUTH HMAC |
|------------------------------------|
And ciphertext has many sections as well.
Ok, I don't see why this library needs a way to extract keys out of another libraries format, they should be providing that functionality for you, verify/decode your data, get the raw bytes and pass it in as normal.
I don't have any intention of adding support for custom key formats so closing this.
Hi,
I'm trying to use your library to exchange encryption keys, those keys are generated by php-encryption library but I'm facing issues that shared keys were generated by PHP-Curve25519 are Pure Bytes and it should be implement some rules provided by php-encryption to ensure key security & integrity.
Are you interesting to integrate and enhance your library feature?
Thanks