Results 1 to 3 of 3

Thread: Hash, base64, binary encryption, secure random numbers [CAPICOM]

  1. #1

    Thread Starter
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Hash, base64, binary encryption, secure random numbers [CAPICOM]

    I got bored today and decided I'd write a better example of using the CAPICOM library with visual basic.

    Requirements:
    Version: CAPICOM 2.1.0.1
    http://www.microsoft.com/downloads/d...DisplayLang=en

    Instructions:
    1. You will need to download and install this CAPICOM library in order to run this project. Just follow the readme that is included in the download.

    2. You must include a reference to CAPICOM in order to use it from within visual basic. All you have to do is go to *project* in the visual basic menu, then *references*. Tick the CAPICOM type library and hit ok, now you should be ready to go.

    General Information:
    Shows how to encode a message from base64 and back.
    Shows how to generate a secure random number. (Number is hex).
    Shows how to generate a hash value.
    Shows how to encrypt a binary file. *Make sure you do this on a copy*
    Shows how to encrypt a simple text message.

    Disclaimer:
    USE THIS AT YOUR OWN RISK.

    Side Notes:
    1. I did zero error handling in this project and didn't test much for incorrect values. In a real project, you would need to add all kinds of error handling code and of course test for incorrect values.

    2. Remember this library is simply a wrapper around the windows library. If your running this on windows 98, it will NOT support the same algorithms and key sizes as windows XP.

    3. I did lazy file handling for the binary example. I simply loaded an entire file into a buffer and then zipped it through the process. This is fine and dandy until you go to encrypt something like a dvd lol.

    4. I just picked out general algorithms to use for the examples, md5 for hash and 3des for encryption. Everything has been mapped out via intellisense in capicom, so as your typing out the function or property, it will popup with your options. Thus I didn't feel the need to comment them out for you.

    5. Make sure you use the latest release of capicom when you run this project.

    Think thats about it,
    Enjoy
    Attached Files Attached Files
    Last edited by Maven; Apr 5th, 2007 at 07:55 PM.
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Hash, base64, binary encryption, secure random numbers [CAPICOM]

    Please include a copy of your source code in a WinZip file as well.

    Many, if not most, of our members use that and would ensure a wider range of viewing and potential use of your project.

    Thanks.

  3. #3

    Thread Starter
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: Hash, base64, binary encryption, secure random numbers [CAPICOM]

    ..... zip
    Attached Files Attached Files
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width