语言

Menu
Sites
Language
Aes multipart encryption or decryption

Hi all,
can anybody help me in implementing aes multipart encryption /decryption ,please guide me in using the following api's

i had followed the below sequence

//for encryption
 

    AesCipher *aescipher = new AesCipher();
    aescipher->Construct("ECB/128/PKCS7PADDING",CIPHER_ENCRYPT);
    SecretKeyGenerator *keygen=new SecretKeyGenerator();
    ISecureRandom *prandno=new AesSecureRandom();
    ByteBuffer *randno1=prandno->GenerateRandomBytesN(16);
    keygen->Construct(*pwdhash);
    ISecretKey *key=(ISecretKey*)keygen->GenerateKeyN();
    aescipher->SetKey(*key);
    aescipher->Initialize();
    ByteBuffer *output = aescipher->UpdateN(*randno1);
    aescipher->FinalizeN();

//for decryption

    AesCipher *aescipher = new AesCipher();
    aescipher->Construct("ECB/128/PKCS7PADDING",CIPHER_DECRYPT);
    SecretKeyGenerator *keygen=new SecretKeyGenerator();
    keygen->Construct(*pwdhash);
    ISecretKey *key=(ISecretKey*)keygen->GenerateKeyN();
    aescipher->SetKey(*key);
    aescipher->Initialize();
    ByteBuffer *input = StringUtil::StringToUtf8N(encrypted data);
    ByteBuffer *output = aescipher->UpdateN(*input);
    aescipher->FinalizeN();

while decrypting i am getting E_System unexecpted error
 please help me 

 

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

4 回复
muditha murthy

What is the error code you get using getlastresult method.

harish kumar kavali

E_SYSTEM unexpected System error 

muditha murthy

System error,some operation has failed, is it possible to provide the sample?

Alex Ashirov

Hi,

As far as I understand,.the sample is here:

https://developer.tizen.org/forums/native-application-development/e_system-error-decryption