/* -*- C -*- * * * © 2010 Hewlett-Packard Development Company, L.P. * * Confidential computer software. Valid license from HP and/or its * subsidiaries required for possession, use, or copying. * * Consistent with FAR 12.211 and 12.212, Commercial Computer Software, * Computer Software Documentation, and Technical Data for Commercial Items * are licensed to the U.S. Government under vendor's standard commercial * license. * * Neither HP nor any of its subsidiaries shall be liable for technical or * editorial errors or omissions contained herein. The information in this * document is provided "as is" without warranty of any kind and is subject to * change without notice. The warranties for HP products are set forth in the * express limited warranty statements accompanying such products. Nothing * herein should be construed as constituting an additional warranty. * * */ /* * Revision history * * Rev Author Date Comments * --- ------ ---- -------- * 001 Rupesh Shantamurty 03-Sep-2010 Initial version * * 002 Prasad SG 08-Sep-2010 Format changes. Added more comments. * Made changes to des_cbc_once() function * to pass correct address to descriptors. */ /* * This program demonstrates the use of the OpenVMS ENCRYPT API to * achieve Triple DES encryption ( CBC mode ). * * The program may be compiled using either C or C++. * * Sample output * $ cc ENCRYPT_3DES * $ link ENCRYPT_3DES * $ run ENCRYPT_3DES * * Type the text that needs to be encrypted(max 32 chars) : Now is the time for all * The Input text in hex is : * 4E6F77206973207468652074696D6520666F7220616C6C00 * The IV in hex is : 1234567890ABCDEF * The 192 bit Key in hex is : * 0123456789ABCDEFFEDCBA9876543210ABCDEF0123456789 * The Cipher text in hex is : * 80B31486E9FE855A033837A54A4DDF1A0E2599734035BEF0 * The Deciphered text in hex is : * 4E6F77206973207468652074696D6520666F7220616C6C00 * The Deciphered text is : * Now is the time for all * $ * */ /* The cipher text generated can be verified using the Cryptosys API * ( www.cryptosys.net ,the Personal Edition is free for personal * use on a stand-alone computer) */ #include #include #include #include #include #include