CryptoEX library

Discussion in 'Additional Libraries' started by agraham, May 1, 2008.

  1. agraham

    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.
     

    Attached Files:

    Last edited: Jul 28, 2010
  2. agraham

    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.
     
  3. agraham

    agraham Expert Licensed User

    Help file now posted in original post.
     
  4. specci48

    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
     
  5. agraham

    agraham Expert Licensed User

    Sorry, I don't understand how it happened but I posted the wrong zip. I have no idea how the one I posted got there :confused:

    Correct help file now there (I hope!)
     
  6. specci48

    specci48 Well-Known Member Licensed User

    I can confirm: The help file is visible (for me) now! ;)
     
  7. agraham

    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: May 14, 2008
  8. bloxmedia

    bloxmedia Member Licensed User

    Wouldn't it be nice to get a Gnupg functionality :sign0188:
     
  9. agraham

    agraham Expert Licensed User

    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.
     
  10. bloxmedia

    bloxmedia Member Licensed User

    Do you think we can do anything with this CryptLIb (don't min the price)
     
  11. agraham

    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.
     
  12. agraham

    agraham Expert Licensed User

    Version 1.3 now posted which has data signing and verification added to the RSA object.

    At the request of LineCutter, which was the reason for posting this version, the source code is included in the zip so the library can be merged.
     
  13. LineCutter

    LineCutter Active Member Licensed User

    Thanks, again!
    :sign0188:
     
  14. agraham

    agraham Expert Licensed User

    Version 1.4 now posted includes byte conversions to and from Base64 as well as encoded strings. The help has been clarified and the string encoding may now be specified - previously it assumed to always be UTF8.
     
  15. derez

    derez Expert Licensed User

    Andrew
    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: Nov 3, 2011
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice