简体   繁体   中英

Poly1305 command line in OpenSSL

I am trying to execute basic ChaCha20-Poly1305 cipher suite using OpenSSL without any TLS or any Apache server. I have succesfully encrypted my text with Chacha20 openssl command but I am unable to produce Poly1305 MAC authentication. I am using dgst command and it seems it only generates SHA algorithm. I am using 1.1.1 openssl version. Can somebody tell me which command shall I use?

If you have a file F you can compute the Poly1305 with the following command:

openssl dgst -mac poly1305 -macopt key:abcd1234abcd1234abcd1234abcd1234 <PATH_TO_F>

The key may also be a hex value with 32 bytes:

openssl dgst -mac poly1305 -macopt hexkey:ee00000000000000000000000000000000000000000000ffffffffffffffffff <PATH_TO_F>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM