-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
Perhaps document in the README the Adobe algorithm.
Lines 2893 to 2932 in d8e5904
| function TfrmMain.DecodeAdobeKey(const sAdobeEncryptedKey: string): string; | |
| // Decode Adobe Key Encryption. A simple substitution cipher. | |
| // Converted from Dave Hope's original C++ version | |
| // Copyright (C) 2008 VersionBoy | |
| // Version 1.0 | |
| type | |
| TAdobeCipher = array[1..24] of string; | |
| const | |
| // It basically represents the decrypted versions of each char in the key. | |
| // aaaa-bbbb-cccc-dddd-eeee-ffff | |
| AdobeCipher: TAdobeCipher = | |
| // Section A. | |
| ('0000000001', '5038647192', '1456053789', '2604371895', | |
| // Section B. | |
| '4753896210', '8145962073', '0319728564', '7901235846', | |
| // Section C. | |
| '7901235846', '0319728564', '8145962073', '4753896210', | |
| // Section D. | |
| '2604371895', '1426053789', '5038647192', '3267408951', | |
| // Section E. | |
| '5038647192', '2604371895', '8145962073', '7901235846', | |
| // Section F. | |
| '3267408951', '1426053789', '4753896210', '0319728564'); | |
| var | |
| sAdobeDecryptedKey: string; | |
| i: integer; | |
| begin | |
| // Ensure we're dealing with a key we can support: | |
| if (sAdobeEncryptedKey <> '') and (IsNumeric(sAdobeEncryptedKey, True)) and (Length(sAdobeEncryptedKey) = 24) then | |
| begin | |
| sAdobeDecryptedKey := sAdobeEncryptedKey; // Set length of sAdobeDecryptedKey | |
| // Iterate through each char in the key. | |
| for i := 1 to Length(sAdobeEncryptedKey) do | |
| sAdobeDecryptedKey[i] := adobeCipher[i][(StrToInt(sAdobeDecryptedKey[i]) + 1)]; | |
| FormatAdobeKey(sAdobeDecryptedKey); | |
| end | |
| else // We don't understand the format we're given, return empty string. | |
| sAdobeDecryptedKey := 'corrupt serial'; | |
| Result := sAdobeDecryptedKey; | |
| end; |