3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/perl
use strict;
use Crypt::CBC ();
use Digest::SHA ();
my $pass = 'test';
my $text = 'hutzelhutzelhutzel';
my $key = &Digest::SHA::sha512_hex($pass);
print "Key1: $key\n";
my $cbc = Crypt::CBC->new(
'cipher' => 'DES',
'key' => $key,
'regenerate_key' => 0,
'prepend_iv' => 0,
);
my $cipher = $cbc->encrypt($text);
print "Cipher: $cipher\n";
$cbc = Crypt::CBC->new(
'cipher' => 'DES',
'key' => $key,
'regenerate_key' => 0,
'prepend_iv' => 0,
);
print "Plain1: ", $cbc->decrypt($cipher), "\n";
# new password
$pass = 'test2';
$key = &Digest::SHA::sha512_hex($pass);
print "Key2: $key\n";
$cbc = Crypt::CBC->new(
'cipher' => 'DES',
'key' => $key,
'regenerate_key' => 0,
'prepend_iv' => 0,
);
print "Plain2: ", $cbc->decrypt($cipher), "\n";
3 Einträge, 1 Seite |