Skip to contents

Which hybrid container a ciphertext is

Usage

morie_crypto_hybrid_container_version(ciphertext)

Arguments

ciphertext

Raw vector from morie_crypto_hybrid_encrypt().

Value

2 for a container written by rmorie / morie 1.4.0 or later (it starts with a marker), 1 for the 1.3.x layout, whose wrapping key was computable from the file and the public key alone.

Examples

kp <- morie_crypto_hybrid_keygen()
morie_crypto_hybrid_container_version(morie_crypto_hybrid_encrypt("x", kp$pk))
#> [1] 2