The first person to submit this thread to the Clay Mathematics Institute wins $1,000,000.
M
mjk340
@mjk340
0
Reputation
4
Posts
36
Profile views
0
Followers
0
Following
Best posts made by mjk340
This user hasn't posted anything yet.
Latest posts made by mjk340
-
RE: Behold the power of doing nothing
-
RE: Hotlinking stylesheet
@morbiuswilters said:
If you don't giggle when shown photos of the mutilated corpses of children or of grotesque sex acts or videos of cats being baked alive in an oven, then you have a psychological problem.
Truth.
-
RE: Who needs boolean columns? Or an int bitmask value?
I inherited a database table with a field called 'PMKEY'.
In each of the 300 rows of so data, the PMKEY field looks like this:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>IPMS</title>
<font color="#000000" face="Arial"></font>IPMS <font style="font-size: 10pt;" color="#000000" face="Arial">PMKEY</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA03_2|PMACT:REAL|PM2:A4|DIV:A|FCN:LC|FCN:LCL|FCN:ESF|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:AESF|DIVREDFCN:A1LC|DIVREDFCN:A1LCL|DIVREDFCN:A1ESF|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA03_3|PMACT:REAL|PM2:A5|DIV:A|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:ART|DIVREDFCN:A2LC|DIVREDFCN:A2LCL|DIVREDFCN:A2RT|LVL:2|RED:2|REDTOT:2|REDNOFM:22|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA03_4|PMACT:REAL|PM2:A6|DIV:A|FCN:LC|FCN:LCL|FCN:COM|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:ACOM|DIVREDFCN:A1LC|DIVREDFCN:A1LCL|DIVREDFCN:A1COM|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA04_1|PMACT:REAL|PM2:A7|DIV:A|FCN:LC|FCN:LCL|FCN:ESF|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:AESF|DIVREDFCN:A1LC|DIVREDFCN:A1LCL|DIVREDFCN:A1ESF|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA04_2|PMACT:REAL|PM2:A8|DIV:A|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:ART|DIVREDFCN:A2LC|DIVREDFCN:A2LCL|DIVREDFCN:A2RT|LVL:2|RED:2|REDTOT:2|REDNOFM:22|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA04_3|PMACT:REAL|PM2:A9|DIV:A|FCN:LC|FCN:LCL|FCN:COM|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:ACOM|DIVREDFCN:A1LC|DIVREDFCN:A1LCL|DIVREDFCN:A1COM|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLA04_4|PMACT:REAL|PM2:AA|DIV:A|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:ALC|DIVFCN:ALCL|DIVFCN:ART|DIVREDFCN:A1LC|DIVREDFCN:A1LCL|DIVREDFCN:A1RT|LVL:2|RED:1|REDTOT:2|REDNOFM:12|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB03_1|PMACT:REAL|PM2:B3|DIV:B|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BRT|DIVREDFCN:B1LC|DIVREDFCN:B1LCL|DIVREDFCN:B1RT|LVL:2|RED:1|REDTOT:2|REDNOFM:12|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB03_2|PMACT:REAL|PM2:B4|DIV:B|FCN:LC|FCN:LCL|FCN:ESF|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BESF|DIVREDFCN:B1LC|DIVREDFCN:B1LCL|DIVREDFCN:B1ESF|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB03_3|PMACT:REAL|PM2:B5|DIV:B|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BRT|DIVREDFCN:B2LC|DIVREDFCN:B2LCL|DIVREDFCN:B2RT|LVL:2|RED:2|REDTOT:2|REDNOFM:22|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB03_4|PMACT:REAL|PM2:B6|DIV:B|FCN:LC|FCN:LCL|FCN:COM|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BCOM|DIVREDFCN:B1LC|DIVREDFCN:B1LCL|DIVREDFCN:B1COM|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB04_1|PMACT:REAL|PM2:B7|DIV:B|FCN:LC|FCN:LCL|FCN:ESF|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BESF|DIVREDFCN:B1LC|DIVREDFCN:B1LCL|DIVREDFCN:B1ESF|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB04_2|PMACT:REAL|PM2:B8|DIV:B|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BRT|DIVREDFCN:B2LC|DIVREDFCN:B2LCL|DIVREDFCN:B2RT|LVL:2|RED:2|REDTOT:2|REDNOFM:22|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB04_3|PMACT:REAL|PM2:B9|DIV:B|FCN:LC|FCN:LCL|FCN:COM|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BCOM|DIVREDFCN:B1LC|DIVREDFCN:B1LCL|DIVREDFCN:B1COM|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLB04_4|PMACT:REAL|PM2:BA|DIV:B|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:BLC|DIVFCN:BLCL|DIVFCN:BRT|DIVREDFCN:B1LC|DIVREDFCN:B1LCL|DIVREDFCN:B1RT|LVL:2|RED:1|REDTOT:2|REDNOFM:12|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLC03_1|PMACT:REAL|PM2:C3|DIV:C|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:CLC|DIVFCN:CLCL|DIVFCN:CRT|DIVREDFCN:C1LC|DIVREDFCN:C1LCL|DIVREDFCN:C1RT|LVL:2|RED:1|REDTOT:2|REDNOFM:12|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLC03_2|PMACT:REAL|PM2:C4|DIV:C|FCN:LC|FCN:LCL|FCN:ESF|DIVFCN:CLC|DIVFCN:CLCL|DIVFCN:CESF|DIVREDFCN:C1LC|DIVREDFCN:C1LCL|DIVREDFCN:C1ESF|LVL:2|RED:1|REDTOT:1|REDNOFM:11|</font> <font style="font-size: 10pt;" color="#000000" face="Arial">|NAME:LCLC03_3|PMACT:REAL|PM2:C5|DIV:C|FCN:LC|FCN:LCL|FCN:RT|DIVFCN:CLC|DIVFCN:CLCL|DIVFCN:CRT|DIVREDFCN:C2LC|DIVREDFCN:C2LCL|DIVREDFCN:C2RT|LVL:2|RED:2|REDTOT:2|REDNOFM:22|</font> -
Homebrew Security
I found this stuffed in a custom database driven report generation script. Aside from the obvious WTF of the lack of real security, this code was interesting because it made me do a Google search to see if 'uncryption' is a real word.
package PassEncrypt;
use strict;
my $xor = 0xEDB88320;
my $maxint = 4294967295;
sub encrypt {
my $class = shift;
my $pass = shift;
my $passnumber = "";
my @passarray;
foreach (split //,$pass) {
my $tempnumber;
$tempnumber = $passnumber . sprintf "%03s",ord $_;
if ($tempnumber > $maxint) {
push @passarray, $passnumber;
$passnumber = "";
}
$passnumber = $passnumber . sprintf "%03s",ord $_;
}
push @passarray, $passnumber;
my @enpassarray;
foreach (@passarray) {
push @enpassarray, $_ ^ $xor;
}
return @enpassarray;
}
sub decrypt {
my $class = shift;
my $enpassarray = shift;
my @passarray = ();
foreach (@$enpassarray) {
push @passarray, $_ ^ $xor;
}
my $uncrypted = "";
foreach (@passarray) {
my $uncryptedpiece = "";
my $passpiece = $_;
my $length = length $passpiece;
while ($length % 3 != 0) {
$passpiece = "0" . $passpiece;
$length = length $passpiece;
}
foreach ($passpiece =~ /(...)/g) {
$uncryptedpiece = $uncryptedpiece .chr $_;
}
$uncrypted = $uncrypted . $uncryptedpiece;
}
return $uncrypted;
}
1;