View previous topic :: View next topic |
Author |
Message |
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Tue Oct 12, 2004 4:50 am Post subject: crypto |
|
|
hello,
i have this problem:
i must develop a routine cobol (on mainframe) that:
a) receiving a var of 8 chars in input (i.e. value "CANIDOIT")
b) it gives back an OK if it satisfies the test:
IF var-input = test-var
THEN ok
ELSE
ko.
where test-var value for example "&%$ |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Tue Oct 12, 2004 5:29 am Post subject: |
|
|
No, but suppose i can develop an algorithm (in a routine) that it associates in a table the value "CANIDOIT" at "&%$ |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Tue Oct 12, 2004 10:28 am Post subject: |
|
|
Long ago i wrote a small encryption decryption cobol routine that uses the Trithemius algorithm. In its purest form, the algorithm is by itself hard to crack (unless you have the encoding decoding matrix) and top of that i introduced my own mixing techniques to bring out a standard encryption. If someone is interested just let me know.
Cheers
Brian |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Oct 12, 2004 10:56 am Post subject: |
|
|
Brian,
I would really appreciate if you can post the code in here.
Thanks,
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Tue Oct 12, 2004 11:07 am Post subject: |
|
|
For a basic use of cryptography (from the security of keys' point-of-view), you may also be interested in reading about REPRO ENCIPHER and REPRO DECIPHER commands. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
|
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Tue Oct 12, 2004 4:15 pm Post subject: |
|
|
Kolusu,
I shall post the code very soon. It contains a copy book and a callable cobol program. It's just laziness that is preventing me from searching for that piece of code.
Brian |
|
Back to top |
|
|
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Tue Oct 12, 2004 4:29 pm Post subject: |
|
|
Here we go..this is the copybook that i am using for both encryption and decryption. This table takes its base design from the Trithemuis algorithm (the Father of Cryptography) and i have added more elements to it so that is flexible. The one constraint is that you cannot have spaces to be encoded or decoded.
TABLE
[code:1:fb541e64df]
01 TRITHEMIUS-TABLEAU.
03 CA-SERIES PIC X(37) VALUE
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 '.
03 FILLER REDEFINES CA-SERIES.
05 CA-SERIES-R OCCURS 37 PIC X.
*
03 CB-SERIES PIC X(37) VALUE
'BCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 A'.
03 FILLER REDEFINES CB-SERIES.
05 CB-SERIES-R OCCURS 37 PIC X.
*
03 CC-SERIES PIC X(37) VALUE
'CDEFGHIJKLMNOPQRSTUVWXYZ0123456789 AB'.
03 FILLER REDEFINES CC-SERIES.
05 CC-SERIES-R OCCURS 37 PIC X.
*
03 CD-SERIES PIC X(37) VALUE
'DEFGHIJKLMNOPQRSTUVWXYZ0123456789 ABC'.
03 FILLER REDEFINES CD-SERIES.
05 CD-SERIES-R OCCURS 37 PIC X.
*
03 CE-SERIES PIC X(37) VALUE
'EFGHIJKLMNOPQRSTUVWXYZ0123456789 ABCD'.
03 FILLER REDEFINES CE-SERIES.
05 CE-SERIES-R OCCURS 37 PIC X.
*
03 CF-SERIES PIC X(37) VALUE
'FGHIJKLMNOPQRSTUVWXYZ0123456789 ABCDE'.
03 FILLER REDEFINES CF-SERIES.
05 CF-SERIES-R OCCURS 37 PIC X.
*
03 CG-SERIES PIC X(37) VALUE
'GHIJKLMNOPQRSTUVWXYZ0123456789 ABCDEF'.
03 FILLER REDEFINES CG-SERIES.
05 CG-SERIES-R OCCURS 37 PIC X.
*
03 CH-SERIES PIC X(37) VALUE
'HIJKLMNOPQRSTUVWXYZ0123456789 ABCDEFG'.
03 FILLER REDEFINES CH-SERIES.
05 CH-SERIES-R OCCURS 37 PIC X.
*
03 CI-SERIES PIC X(37) VALUE
'IJKLMNOPQRSTUVWXYZ0123456789 ABCDEFGH'.
03 FILLER REDEFINES Ci-SERIES.
05 CI-SERIES-R OCCURS 37 PIC X.
*
03 CJ-SERIES PIC X(37) VALUE
'JKLMNOPQRSTUVWXYZ0123456789 ABCDEFGHI'.
03 FILLER REDEFINES CJ-SERIES.
05 CJ-SERIES-R OCCURS 37 PIC X.
*
03 CK-SERIES PIC X(37) VALUE
'KLMNOPQRSTUVWXYZ0123456789 ABCDEFGHIJ'.
03 FILLER REDEFINES CK-SERIES.
05 CK-SERIES-R OCCURS 37 PIC X.
*
03 CL-SERIES PIC X(37) VALUE
'LMNOPQRSTUVWXYZ0123456789 ABCDEFGHIJK'.
03 FILLER REDEFINES CL-SERIES.
05 CL-SERIES-R OCCURS 37 PIC X.
*
03 CM-SERIES PIC X(37) VALUE
'MNOPQRSTUVWXYZ0123456789 ABCDEFGHIJKL'.
03 FILLER REDEFINES CM-SERIES.
05 CM-SERIES-R OCCURS 37 PIC X.
*
03 CN-SERIES PIC X(37) VALUE
'NOPQRSTUVWXYZ0123456789 ABCDEFGHIJKLM'.
03 FILLER REDEFINES CN-SERIES.
05 CN-SERIES-R OCCURS 37 PIC X.
*
03 CO-SERIES PIC X(37) VALUE
'OPQRSTUVWXYZ0123456789 ABCDEFGHIJKLMN'.
03 FILLER REDEFINES CO-SERIES.
05 CO-SERIES-R OCCURS 37 PIC X.
*
03 CP-SERIES PIC X(37) VALUE
'PQRSTUVWXYZ0123456789 ABCDEFGHIJKLMNO'.
03 FILLER REDEFINES CP-SERIES.
05 Cp-SERIES-R OCCURS 37 PIC X.
*
03 CQ-SERIES PIC X(37) VALUE
'QRSTUVWXYZ0123456789 ABCDEFGHIJKLMNOP'.
03 FILLER REDEFINES CQ-SERIES.
05 CQ-SERIES-R OCCURS 37 PIC X.
*
03 CR-SERIES PIC X(37) VALUE
'RSTUVWXYZ0123456789 ABCDEFGHIJKLMNOPQ'.
03 FILLER REDEFINES CR-SERIES.
05 CR-SERIES-R OCCURS 37 PIC X.
*
03 CS-SERIES PIC X(37) VALUE
'STUVWXYZ0123456789 ABCDEFGHIJKLMNOPQR'.
03 FILLER REDEFINES CS-SERIES.
05 CS-SERIES-R OCCURS 37 PIC X.
*
03 CT-SERIES PIC X(37) VALUE
'TUVWXYZ0123456789 ABCDEFGHIJKLMNOPQRS'.
03 FILLER REDEFINES CT-SERIES.
05 CT-SERIES-R OCCURS 37 PIC X.
*
03 CU-SERIES PIC X(37) VALUE
'UVWXYZ0123456789 ABCDEFGHIJKLMNOPQRST'.
03 FILLER REDEFINES CU-SERIES.
05 CU-SERIES-R OCCURS 37 PIC X.
*
03 CV-SERIES PIC X(37) VALUE
'VWXYZ0123456789 ABCDEFGHIJKLMNOPQRSTU'.
03 FILLER REDEFINES CV-SERIES.
05 CV-SERIES-R OCCURS 37 PIC X.
*
03 CW-SERIES PIC X(37) VALUE
'WXYZ0123456789 ABCDEFGHIJKLMNOPQRSTUV'.
03 FILLER REDEFINES CW-SERIES.
05 CW-SERIES-R OCCURS 37 PIC X.
*
03 CX-SERIES PIC X(37) VALUE
'XYZ0123456789 ABCDEFGHIJKLMNOPQRSTUVW'.
03 FILLER REDEFINES CX-SERIES.
05 CX-SERIES-R OCCURS 37 PIC X.
*
03 CY-SERIES PIC X(37) VALUE
'YZ0123456789 ABCDEFGHIJKLMNOPQRSTUVWX'.
03 FILLER REDEFINES CY-SERIES.
05 CY-SERIES-R OCCURS 37 PIC X.
*
03 CZ-SERIES PIC X(37) VALUE
'Z0123456789 ABCDEFGHIJKLMNOPQRSTUVWXY'.
03 FILLER REDEFINES CZ-SERIES.
05 CZ-SERIES-R OCCURS 37 PIC X.
*
03 0-SERIES PIC X(37) VALUE
'0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
03 FILLER REDEFINES 0-SERIES.
05 0-SERIES-R OCCURS 37 PIC X.
*
03 1-SERIES PIC X(37) VALUE
'123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ0'.
03 FILLER REDEFINES 1-SERIES.
05 1-SERIES-R OCCURS 37 PIC X.
*
03 2-SERIES PIC X(37) VALUE
'23456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ01'.
03 FILLER REDEFINES 2-SERIES.
05 2-SERIES-R OCCURS 37 PIC X.
*
03 3-SERIES PIC X(37) VALUE
'3456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ012'.
03 FILLER REDEFINES 3-SERIES.
05 3-SERIES-R OCCURS 37 PIC X.
*
03 4-SERIES PIC X(37) VALUE
'456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ0123'.
03 FILLER REDEFINES 4-SERIES.
05 4-SERIES-R OCCURS 37 PIC X.
*
03 5-SERIES PIC X(37) VALUE
'56789 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234'.
03 FILLER REDEFINES 5-SERIES.
05 5-SERIES-R OCCURS 37 PIC X.
*
03 6-SERIES PIC X(37) VALUE
'6789 ABCDEFGHIJKLMNOPQRSTUVWXYZ012345'.
03 FILLER REDEFINES 6-SERIES.
05 6-SERIES-R OCCURS 37 PIC X.
*
03 7-SERIES PIC X(37) VALUE
'789 ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456'.
03 FILLER REDEFINES 7-SERIES.
05 7-SERIES-R OCCURS 37 PIC X.
*
03 8-SERIES PIC X(37) VALUE
'89 ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567'.
03 FILLER REDEFINES 8-SERIES.
05 8-SERIES-R OCCURS 37 PIC X.
*
03 9-SERIES PIC X(37) VALUE
'9 ABCDEFGHIJKLMNOPQRSTUVWXYZ012345678'.
03 FILLER REDEFINES 9-SERIES.
05 9-SERIES-R OCCURS 37 PIC X.
*
03 SPACE-SERIES PIC X(37) VALUE
' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.
03 FILLER REDEFINES SPACE-SERIES.
05 SPACE-SERIES-R OCCURS 37 PIC X.
*
03 SA-SERIES PIC X(57) VALUE
' |
|
Back to top |
|
|
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Wed Oct 13, 2004 5:05 am Post subject: |
|
|
thank you boys,it's all ok and its enought for me. |
|
Back to top |
|
|
|
|