Data Encryption Standard: Difference between revisions
m
touched up implementation
m (touched up implementation) |
|||
Line 1,203:
}
ubyte[] decrypt(const ubyte[] key, const ubyte[] encoded) in {
assert(key.length == 8, "Incorrect key size");
Line 1,243 ⟶ 1,241:
// split 'kp' in half and process the resulting series of 'c' and 'd'
BitArray[] c;
BitArray[] d;▼
foreach (_; 0..18) {
c ~= bitArrayOfSize(56);
▲ BitArray[] d;
d ~= bitArrayOfSize(28);
}
foreach (i; 0..28) {
c[0][i] = kp[i];
d[0][i] = kp[i + 28];
}
Line 1,302 ⟶ 1,296:
foreach (i; 0..32) {
left[0][i] = mp[i];
right[0][i] = mp[i + 32];
}
Line 1,434 ⟶ 1,426:
writeln;
}
}
{{out}}
<pre>Key : 133457799BBCDFF1
|