IronCoreLabs / recrypt-rs

A set of cryptographic primitives for building a multi-hop Proxy Re-encryption scheme, known as Transform Encryption.
https://crates.io/crates/recrypt
GNU Affero General Public License v3.0
144 stars 23 forks source link

Obtaining bytes used to instantiate Plaintext back #172

Closed UMR1352 closed 2 years ago

UMR1352 commented 2 years ago

Hello, I realized that if I try to invoke Plaintext::new(<some bytes>) and then plaintext.bytes() the two slices don't match. Plaintext probably needs to encode the input bytes in some way but is it possible somehow to get the original ones back?

coltfred commented 2 years ago

@UMR1352 This is only the case when you don't generate a correct plaintext. Plaintext in the context of a proxy re-encryption library is not the same as a plaintext for AES. See https://github.com/IronCoreLabs/recrypt-rs/issues/170#issuecomment-1161788983 and https://github.com/IronCoreLabs/recrypt-rs/issues/125