From: Vance Heron Date: 2004-04-15T11:47:16+09:00 Subject: Re: openssl ciphers Hello, I'm a relatively new user, trying to build an app that will do an NTLM authentication over HTTP. Part of the algorithm involves DES encrypting the string "KGS!@#$%" using a key consisting of the following bytes: "0x52 0xa2 0x51 0x6b 0x25 0x2a 0x51 0x61" In the example, the encrypted text is supposed to be: "0xff 0x37 0x50 0xbc 0xc2 0xb2 0x24 0x12" but when using openssl in ruby I get "0xc7 0x17 0x53 0x90 0x28 0x9e 0xa1 0xe3 0x04 0xa4 0xbe 0x0b 0x1a 0xb8 0xf6 0x29" which is twice a long, in addition to being different from what's expected. Here's the ruby code segment I'm using... des = OpenSSL::Cipher::Cipher.new("DES") des.encrypt( key1 ) res1 = des.update( magic ) res1 << des.final Instantiating des with des = OpenSSL::Cipher::DES.new gives the same undesired result Using DES-ECB gives a different answer, also not the expected/desired one. It works in C with the following code ... /* encrypt magic w/DES using Key 1 */ des_set_key_checked((const_des_cblock *)key1, sked); des_ecb_encrypt((const_des_cblock *) magic, \ (const_des_cblock *)lmhash, sked, 1); Any thoughts or help would be appreciated. Thank You, Vance heron@jpl.nasa.gov