Net-SSH-Perl

 view release on metacpan or  search on metacpan

t/05-cipher.t  view on Meta::CPAN

    _check_it($ciph1, $ciph2);

    ## Test encryption with a non-empty passphrase.
    $ciph1 = Net::SSH::Perl::Cipher->new_from_key_str($cname, $PASS);
    $ciph2 = Net::SSH::Perl::Cipher->new_from_key_str($cname, $PASS);
    _check_it($ciph1, $ciph2);
}

sub _check_it {
    my($ciph1, $ciph2) = @_;
	my $line = (caller)[2];
    ok($ciph1, "First argument was true from line $line");
    ok($ciph2, "Second argument was true from line $line");
    my($enc, $dec);
    $enc = $ciph1->encrypt(_checkbytes());
    $dec = $ciph2->decrypt($enc);
    ok(ord substr($dec, 0, 1) == ord substr($dec, 2, 1), "Values matched from line $line");
    ok(ord substr($dec, 1, 1) == ord substr($dec, 3, 1), "Values matched from line $line");
}

sub _checkbytes {



( run in 1.483 second using v1.01-cache-2.11-cpan-a3c8064c92c )