|
Re: [vmu] Attempt to decypher Dreamkey attachment format
> It's encrypted. Alessandro and I did an experiment with a file
> containing only a large amount of zeroes. The attachment had the
> expected length, but the data was not even periodical. So it's
> probably RC4 encrypted or something.
>
>
> // Marcus
The encoding format is as follows:
Here is Perl code to convert the modified Base64 format. After it is
decoded, you then pass it through a standard Base64 decoder.
# -----------------------------------------------------
# encryption table
@base64 = ('A','B','C','D','E','F','G','H','I','J',
'K','L','M','N','O','P','Q','R','S','T',
'U','V','W','X','Y','Z','a','b','c','d',
'e','f','g','h','i','j','k','l','m','n',
'o','p','q','r','s','t','u','v','w','x',
'y','z','0','1','2','3','4','5','6','7',
'8','9','+','/','=');
@dp_base64 = ('A','Z','O','L','Y','N','d','n','E','T',
'm','P','6','c','i','3','S','z','e','9',
'I','y','X','B','h','D','g','f','Q','q',
'7','l','5','b','a','t','M','4','r','p',
'K','J','j','8','C','u','s','x','R','F',
'+','k','2','V','0','w','U','G','o','1',
'v','W','H','/','=');
######################################################################
#######
# decode_dp_base64(<DP base 64'd data stream>)
# returns an array derived from DP base64 decoding the data stream.
#
# Argument: Character lines encoded by DP_BASE64.
# Back: Encoded bit character lines.
######################################################################
######
sub decode_dp_base64 {
my $src = shift;
my $bindata = ();
my $i;
my $count = 0;
foreach my $c(split(//,$src))
{
if ($c eq '-') {
last;
}
for ($i = 0; $i < 65; $i++)
{
if ($c eq $dp_base64[$i]) {
$count++;
$bindata .= $base64[$i];
if ($count == 77) {
$count = 0;
$bindata .= "\n";
}
last;
}
}
}
return $bindata;
}
|
"Alexander Villagran" <villagra@...>
villagra@...
Send Email
|