![]() ![]() ![]() 2) The chain data size was made to be 32. So, what was missing was: 1) Convert the 32-byte string of hexadecimal characters to it's 16-byte string representation. MOVE '0000000000000000' TO WS-ENC-cCLEAR-TEXTĬALL CT-cENC-ROUTINE USING WS-ENC-nRETURN-CODE, I did it! The code was the following: 77 CT-cENC-ROUTINE PIC X(7) VALUE 'CSNBSYE'.ġ0 WS-ENC-nEXIT-DATA-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nRULE-ARRAY-COUNT PIC 9(8) COMP.ġ0 WS-ENC-cKEY-IDENT-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nKEY-PARMS-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nINIT-VECTOR-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nCHAIN-DATA-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nCLEAR-TEXT-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nCYPHER-TEXT-LENGTH PIC 9(8) COMP.ġ0 WS-ENC-nOPTIONAL-DATA-LENGTH PIC 9(8) COMP. So of your investigated alternatives it seems that only CSNBSYE is compatible with your requirements but you have to study its exact parameter-formats and usage. Instead the second argument is a password that is hashed to obtain the final encryption key. Last but not least ENCRYPT_TDES: this function is using 3DES but it does not accept a plain key. To use actual hex-representation of the byte-values you have to append a X after the closing apostrophe of your literals.Īlso note that moving ZERO into a PIC X item resulte in 'F0'X while using LOW-VALUE results in '00'.Īnother point is that you seem to be comparing the 3DES results from the website with the DES results from CSNBECO or CSNBSYE - but they are different ciphers and so should return different results. the EBCDIC-representation of the characters you passed. you think you pass CSNBSYE a 16-byte key of '2DF65FD88EA9E17E3C66950387F91DE2'X while you are passing a 32-byte string starting with 'F2C4C6F6F5C6C429F8'X - i.e. Most of your confusion seems to come from the fact that you mistake hex-strings for byte-values. When I want to fill DENATURETEMP, key2 is read properly but key is automatically using the old value inserted before. My question is: how can I obtain the result above in a Cobol program, using any of the tools provided by IBM? The result I'm expecting is the same obtained from testing in this website:, with the following data: SELECT ENCRYPT_TDES(:CLEAR-TEXT, '2DF65FD88EA9E17E3C66950387F91DE2')īut none of these approaches returned the result I expected. Using CSNBECO 77 CSNBECO PIC X(7) VALUE 'CSNBECO'. I tried these three approaches: Using CSNBSYE 77 CSNBSYE PIC X(7) VALUE 'CSNBSYE'. I have access to DB2 and ICSF callable services. CLEAR_KEY: A 32-character string of hexadecimal characters to be used as the encryption key.Receives a clear encryption key and a clear text and returns a cyphered text using the 3DES algorithm. I'm trying to write a Cobol program with the following interface: Objective ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |