Simple Encrypt /DeCrypt using imported DES key
From: Aiden (Aiden.Devine@ffastfill.com)
Date: 08/12/02
- Next message: Tronyc: "How do I Password Protect my computer?"
- Previous message: Eric: "Re: 3DES with PROV_RSA_FULL ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Aiden" <Aiden.Devine@ffastfill.com> Date: Mon, 12 Aug 2002 12:52:58 +0100
Hi,
I am writing a simple dll to encrypt and decrypt messages using DES (in the
first instance). For my test app I have created and exported to a file a DES
key using:
::CryptGenKey(this->m_hCryptProvider, ALG_SID_DES, CRYPT_EXPORTABLE, &hKey)
...
::CryptExportKey(hKey, 0, PUBLICKEYBLOB, 0, pbKeyBlob, &dwKeyBlobLen)
My encryption class both encrypts and decrypts messages, so when I import
the encryption key, I create a duplicate to use as a decryption key:
::CryptDuplicateKey( m_hEncryptKey, NULL, 0, &m_hDecryptKey) )
My test harness then encodes a message using the encryption key (works
fine), and Decodes the result using the decryption key. I am getting
NTE_BAD_KEY error each time I attempt to decode.
Any ideas where I should be looking ?
Thanks,
- Next message: Tronyc: "How do I Password Protect my computer?"
- Previous message: Eric: "Re: 3DES with PROV_RSA_FULL ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|