[Tinyos-help] How to use TinySec at application layer ?

Andrea Pacini pacionet at email.it
Sat Sep 17 14:40:10 PDT 2005


I'd like to know if it is possible using TinySec at application layer . I found TinySecApp interface with the following commands:

init()
encryptData()
decryptData()

I tried to use them and they return with SUCCESS but decryptData() doesn't return the correct plaintext. Is there an example on how to use them ? 

A bit of my code :


res=call TSEC.init(skey,1);
res= call TSEC.encryptData(plaintext,plaintextlength,IVlen,IV,ciphertext);              // CIPHERING PLAINTEXT
}


event result_t TSEC.encryptDataDone (result_t result, uint8_t* ciphertext) {
           [..]
           res= call TSEC.decryptData (ciphertext, plaintextlength,IVlen,IV,plaintext);        // DECIPHERING IMMEDIATELY CIPHERTEXT
}


event result_t TSEC.decryptDataDone (result_t result, uint8_t * plaintext) {

        for (i=0;i<plaintextlength;i++)
                       dbg(DBG_AM," %d\n",plaintext[i] );                                                     // PRINTING  PLAINTEXT : IT IS DIFFERENT FROM THE ORIGINAL

       return result;
}


THANKS for your help
Andrea
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Prestiti e Finanziamenti con un semplice click, scopri subito se sei finanziabile cliccando qui
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid)10&d-9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20050917/84738884/attachment.html


More information about the Tinyos-help mailing list