CryptoEX library

agraham

Expert
Licensed User
This library implements the MD5 Message Digest hash algorithm and also stream and single block DES encryption and decryption. It works fine with itself but I can't guarantee it meets the DES standard as I have no other DES implementation to test it against. However as it uses the .NET DES implementation I would expect it to be OK.

I can't be bothered to write a help file at the moment file but there are some explanatory comments in the examples. Maybe later!

EDIT : Version1.1 posted, see post below.

EDIT : Help file now posted.

EDIT : Version 1.2 posted with updated help included in zip. See post below for details.

EDIT : Version 1.3 posted with source. See post #12 below for details.

EDIT : Version 1.4 posted with source. See post #14 below for details.
 

Attachments

Last edited:

agraham

Expert
Licensed User
OK, so I got carried away with the fun bit :sign0137:. Version 1.1 posted above now does Base64 encoding/decoding, SHA1 and MD5 hashing together with DES, TripleDES, RC2, Rijndael and RSA encryption/decryption. Examples of all attached. Needs .NET 2.0 as the encryption facilities in .NET1.0/1.1 are primitive. Should work on the device as well as the desktop but I haven't fully checked that.

Base64, SHA1 and MD5 results conform to published examples in Wikipedia.

The encryptions all round trip successfully but no guarantees for compatibility interworking with third party data as I can't try that.

:sign0013: Still no help file - I need an enthusiasm transplant to get started on it.
 

specci48

Well-Known Member
Licensed User
Hello agraham,

I'll think I must be blind, but I cannot find the help file. :sign0013:
Which is the "original post" :confused:


specci48
 

agraham

Expert
Licensed User
Version 1.2 posted in original post. Changes are to the symmetric alorithms which previously used the default key sizes.

GenerateIV() now added to generate a random intialisation vector for use with block chaining. Existing IV property is used to access it if necessary.

New property BlockSize added to match existing property KeySize, but is not particularly useful as all these algorithms work on fixed block sizes.

New property LegalBlockSizes added to match LegalKeySizes, see below. Again not much use!

New property LegalKeySizes added. TripleDES, RC2 and Rijndael can have variable key sizes. This returns an array giving the max and min keysizes and the size of the steps between them.

EDIT : I've just noticed that the RSAdemo has the bitwise library added. This is a hangover and is not needed so you can remove the library and the bit object.
 
Last edited:

agraham

Expert
Licensed User
Wouldn't it be nice to get a Gnupg functionality
I am afraid that won't happen, from me at least!. .NET has a well developed security model which this library partly exposes and I have limited the facilities to those that are available on .NET 2.0 Compact Framework as it's security is a sub-set of the full framework capability.
 

agraham

Expert
Licensed User
The question is what do you want to achieve? As I'm doing this for fun I'm only prepared to get involved in supplying the low-level algorithms and functions that I can independently test and verify, like in my library. For anything further involving certificates and interactions then you are on your own and really need to consult a paid professional with security experience.
 

derez

Expert
Licensed User
Andrew
The encryptions all round trip successfully but no guarantees for compatibility interworking with third party data as I can't try that.
As you saw in my previous question under byteconversion library, I'm trying to get a match between b4ppc app and b4a app on encryption.

I'm using the same key array in both apps.
In b4a there is an initialization vector which doesn't exist here.
Here there is mode, but neither made it the same.
Can you advise what has to be done (probably in the b4a app) to make it compatible ?
Thanks

Alternatively - maybe another encryption method will work better, can you recommend ?

edit: Hold it, I found IV in cryptoEx as well, I'll try to include it and check ...

Edit: Big success !, with mode 1 and using the same IV in both apps:sign0060:
 
Last edited:
Top