Thread Problem mit Twofish (9 answers)
Opened by root at 2005-09-08 23:26

J-jayz-Z
 2005-09-09 00:49
#57776 #57776
User since
2005-04-13
625 Artikel
BenutzerIn
[Homepage] [default_avatar]
Okay, wie es aussieht, muss das passwort 16bytes sein.
Ja, ein Buchstabe = 8 Bit und 8 Bit = ein Byte.
Hier meine versuche:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
use strict;
use warnings;

use Crypt::Twofish;

my $key = "oe" x 8;
my $cipher = Crypt::Twofish->new($key);
my $passwd = 'eins' x 4;

print "Passwort ist gültig\n" if($cipher->blocksize() == length($passwd));
print $cipher->encrypt($passwd). "\n";
\n\n

<!--EDIT|J-jayz-Z|1126212717-->
perl -Mstrict -Mwarnings -e 'package blub; sub new { bless {} } sub bar {my $self=shift; $self->{bla}="5065726c2d436f6d6d756e697479"; return $self->{bla};} my $foo=blub->new();print "Hallo ";print pack("H*",$foo->bar()); print "\n"'

http://perl-tutor.de

View full thread Problem mit Twofish