Thread einfacher verschlüsselungsalgorithmus: .. (7 answers)
Opened by steinwolf at 2003-09-25 21:49

esskar
 2003-09-26 00:52
#56944 #56944
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
ich würde einfach vorne einfach ein paar bytes dranhängen...
dann bist du wohl format unabhängig...
mal sehen

Code: (dl )
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/perl
# image destroy
# esskar aka Sascha Kiefer for perl-community

use strict;
use bytes;

my $secret_pbdata = "esskar aka Sascha Kiefer";
my $secret_cbdata = length $secret_pbdata;


sub destroy_image
{
my ($file) = @_;
my $image = "";
if($image = read_binfile($file))
{
$image = "$_$image" foreach (split('', $secret_pbdata));
write_binfile($file, $image);
}
}

sub fix_image
{
my ($file) = @_;
my $image = "";
if($image = read_binfile($file))
{
$image = substr($image, $secret_cbdata);
write_binfile($file, $image);
}
}

sub read_binfile
{
my ($file) = @_;
my $data = "";

if(open(FILE, "< $file"))
{
binmode FILE;
my ($len, $off) = (0, 0);
my $buffer = "";
while($len = read(FILE, $buffer, $off))
{
$data .= $buffer;
$len += $off;
}

close(FILE);
}

return $data;
}

sub write_binfile
{
my ($file, $data) = @_;
my $data = "";

if(open(FILE, "> $file"))
{
binmode FILE;
print FILE $data;
close(FILE);
}
}


ungetestet!

View full thread einfacher verschlüsselungsalgorithmus: ..