File: none.pm

package info (click to toggle)
libcrypt-cbc-perl 3.07-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 364 kB
  • sloc: perl: 2,074; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 565 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package Crypt::CBC::PBKDF::none;
use strict;
use Carp 'croak';
use base 'Crypt::CBC::PBKDF::opensslv1';

our $VERSION = '3.07';
# options:
# key_len    => 32    default
# iv_len     => 16    default

sub generate_hash {
    my $self = shift;
    my ($salt,$passphrase) = @_;
    # ALERT: in this case passphrase IS the key and the salt is ignored
    # Croak unless key matches key length
    my $keylen = $self->{key_len};
    length($passphrase) == $keylen or croak "For selected cipher, the key must be exactly $keylen bytes long";
    return $passphrase;
}

1;