1Net::SSH::Perl::Cipher:U:sCehracChoanPtorliyb(u3t)ed PerNletD:o:cSuSmHe:n:tPaetrilo:n:Cipher::ChachaPoly(3)
2
3
4
6 Net::SSH::Perl::Cipher::ChachaPoly - provides Chacha20 encryption with
7 Poly1305 Authentication support for Net::SSH::Perl.
8
10 use Net::SSH::Perl::Cipher;
11 my $eight_byte_iv = pack('N',0) . pack('N',1);
12 my $eight_byte_counter = chr(1) . 7 x "\0"; # little endian
13
14 my $cipher = Net::SSH::Perl::Cipher->new('ChachaPoly', $key);
15
16 # generate poly key
17 $cipher->ivsetup($eight_byte_iv,undef);
18 my $poly_key = "\0" x POLY1305_KEYLEN; # 32 byte key
19 $poly_key = $ciph->encrypt($poly_key);
20
21 $cipher->ivsetup($eight_byte_iv,$eight_byte_counter);
22 my $enc = $cipher->encrypt($plaintext);
23 my $tag = $cipher->poly1305($enc,$poly_key);
24
26 Net::SSH::Perl::Cipher::Chacha provides Chacha20 encryption with
27 Poly1305 support for Net::SSH::Perl.
28
29 This module requires Crypt::OpenSSH::ChachaPoly which provides a
30 wrapper to the OpenSSH Chacha and Poly1305 functions.
31
33 Lance Kinley E<lkinley@loyaltymethods.com>
34
35 Copyright (c) 2015 Loyalty Methods, Inc.
36
38 This program is free software; you can redistribute it and/or modify it
39 under the same terms as Perl itself.
40
42 Hey! The above document had some coding errors, which are explained
43 below:
44
45 Around line 149:
46 Unknown E content in E<lkinley@loyaltymethods.com>
47
48
49
50perl v5.34.0 2021-07-N2e2t::SSH::Perl::Cipher::ChachaPoly(3)