Ok I think I'm getting closer.. but have some questions

1. Is this correct?
2. How do I set my key?
3. The notes say there is no BTEA::BLOCKSIZE so what do I use?

Many thanks

Colin

int main(void){
        string ciphertext = "GOBBELDYGOOK GOES HERE FOR TESTING==";
        string decryptedtext;

        byte key[] = {1234, 5678, 9999, 9999};
        byte iv[ CryptoPP::TEA::BLOCKSIZE ];
    // memset( key, 0x00, CryptoPP::BTEA::DEFAULT_KEYLENGTH );
        memset( iv, 0x00, CryptoPP::TEA::BLOCKSIZE );
        
        CryptoPP::BTEA::Decryption beaDecryption(key,  
CryptoPP::BTEA::DEFAULT_KEYLENGTH);
        CryptoPP::CBC_Mode_ExternalCipher::Decryption  
cbcDecryption( beaDecryption, iv);
        CryptoPP::StreamTransformationFilter stfDecryptor(cbcDecryption, new  
CryptoPP::StringSink( decryptedtext ) );
        stfDecryptor.Put( reinterpret_cast<const unsigned  
char*>( ciphertext.c_str() ), ciphertext.size() );
        stfDecryptor.MessageEnd();
        
        cout << decryptedtext << "\n";
}

On 2 Apr 2008, at 14:23, Colin Bell wrote:

> Hi all
>
> I've been searching all afternoon for some Crypto++ BTEA examples.  
> Besides the Crypto++ site been down, I can't find anything helpful.
>
> Would someone mind pointing me in the right direction to doing a  
> BTEA encryption and then a decryption with a key ie:"1234 1111 2222  
> 3333" and a string. An example would really put me out of my misery!
>
> Many many thanks
>
> Colin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to