Click here to Skip to main content
Licence 
First Posted 7 May 2000
Views 81,172
Bookmarked 38 times

CryptIt

By | 7 May 2000 | Article
Keep sensitive data safe via encryption
  • Download source files - 129 Kb
  • Sample Image - CryptIt.gif

    I saw an article (April 1999 - VCJ) by Kurtz, and wrote a simple ATL DLL to use it in an ASP page. I just wanted to show a number of ways (examples) on how to implement it. This article has 4 projects: ATL (the DLL), VC++ (using the DLL), VB (using the DLL), and ASP (using the DLL)

    This was all his code (ARACrypt.cpp/h) and I just used his Class to play.

    Note: I did find something funny in the VB example. When I ran it on WinNT, the Decryption didn't seem to work correctly (see comments in VB code). When I returned encryption data into the text field (Text1.Text) the Decryption would be wrong (some characters). Once I had the returned encryption data go into a String variable it all worked well (see VB code below). When on the Win2000 OS it worked fine the other way...go figure? Of course I fixed it, but check it out if you have two Operating Systems (WinNT/Win2000).

    Option Explicit
    ' MUST be registered
    Dim CryptTest As CRYPTITLib.Cryptor
    
    Private Sub Command1_Click()
    
        Set CryptTest = New CRYPTITLib.Cryptor
    
        CryptTest.PassPhrase = Text1.Text
        CryptTest.StringToCrypt = Text2.Text
        CryptTest.DoCrypting
    
        ' Normally I would not store to a string
        ' variable, update the text control, then
        ' use the variable to set the property (below)
        ' but WinNT 4.0 (SP3)/VB 6.0 (SP3) environment I get
        ' the wrong decryption...go figure?  Try it:
        '
        ' Text3.Text = CryptTest.ReturnCrypted
        '
        ' CryptTest.StringToCrypt = Text3.Text
        '
        ' The above does work on Win2000/VB 6.0 (SP3)!!!
        '
        ' again, "go figure!"
        '
        Dim strTest As String
        strTest = CryptTest.ReturnCrypted
        Text3.Text = strTest
        
        CryptTest.StringToCrypt = strTest
        CryptTest.DoCrypting
    
        Text4.Text = CryptTest.ReturnCrypted
        
        Set CryptTest = Nothing
    
    End Sub
    

    I hope that others find this useful.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Dan Madden

    Engineer

    Germany Germany

    Member

    I have been programming for 19 years (Unix C, Scripting, VB, C/C++, C#). I am getting too old to talk about it and been in the Security line of work (both Military/Civilian) for 25+ years.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralUsing this DLL in C++ PinmemberGauravLa20:56 11 Dec '06  
    AnswerRe: Using this DLL in C++ PinmemberDan Madden2:14 14 Dec '06  
    Generalsending encripted string via http PinmemberAzerothAr10:09 22 May '06  
    Generalw98 Pinmembertxemuki0:41 20 Jul '05  
    GeneralMother Algorithm PinmemberOmar Malik20:41 6 Oct '04  
    GeneralRe: Mother Algorithm PinmemberDan Madden3:40 7 Oct '04  
    Generalno source code provided PinmemberYanivY20:02 22 Oct '02  
    GeneralCSP Help PinmemberNiyo12:10 17 Jul '01  
    GeneralDoesn't work. PinsussPeter Hendrix23:17 14 May '00  
    GeneralDoesn't work. PinmemberTin2:13 10 Jul '01  
    GeneralRe: Doesn't work. PinmemberMatt Esterly9:51 6 Aug '01  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.5.120528.1 | Last Updated 8 May 2000
    Article Copyright 2000 by Dan Madden
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid