views:

207

answers:

3

Hello I have been using LibTomCrypt to use SHA1 encryption ( for data integrity checking ) on mobile devices (iPhone OS and Android for the moment ). I was wondering if anyone is using anything else, things to consider are Portability ( C preferred but C++ is also an option ), and libraries size ( small == better for my particular needs ).

Thanks

A: 

For size/speed -- you can get Openssl to generate flattened assembly for certain processors. I suggest you look into the build directories to see what is possible. I usually build my own Openssl library based on what I need.

Hassan Syed
+1  A: 

You might write a wrapper class that calls CommonCrypto routines if you're on an iPhone, to reduce your library size requirements and enforce portability. Your wrapper, for example, would call other routines if compiled on another platform. The nice thing about CommonCrypto is that it is pre-built by Apple. Calls to it are also entirely in C.

Alex Reynolds
I think it's a pretty good idea, but I think for my needs I found a better solution.
Mr.Gando
A: 

I've looked a lot of libraries, and in the end I ended up going with "TomCrypt", for the following reasons:

1) Excellent portability. You can customize the library in a very very easy way in order to almost assure portability between lot's of devices.

2) Very modular, I could (in a very easy way) pick up and compile only the encryption algorithms I needed for my particular application, ( in this example it was SHA-1 and a couple of others)

3) Very very lightweight. Because of the modularity, it ended up being a very lightweight addition to my code.

Mr.Gando