📄 cryptit.html
字号:
<!-- The Code Project article submission template (HTML version)
Using this template will help us post your article sooner. We are using MS
IIS and ASP pages on the server, allowing us to simplify the templates used
to create the articles.
To fill in this template, just follow the 3 easy steps below:
1. Fill in the article description details
2. Add links to your images and downloads
3. Include the main article text
That's all there is to it! All formatting will be done by the ASP script
engine.
-->
<html>
<head>
<title>The Code Project</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<Style>
BODY { FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10pt }
H2 { COLOR: #0066ff; FONT-SIZE: 13pt; FONT-WEIGHT: bold; }
H3 { COLOR: #0066ff; FONT-SIZE: 12pt; FONT-WEIGHT: bold; font-style: italic; }
H3 { COLOR: #0066ff; FONT-SIZE: 11pt; FONT-WEIGHT: bold; }
PRE { BACKGROUND-COLOR: #FBEDBB; FONT-FAMILY: "Courier New", Courier, mono; WHITE-SPACE: pre; }
CODE { COLOR: #990000; FONT-FAMILY: "Courier New", Courier, mono; }
</style>
</head>
<body bgcolor="#FFFFFF" color=#000000>
<!-- STEP 1. Fill in the details (CodeProject will reformat this section for you) -->
<pre>
Title: CryptIt
Author: Daniel Madden
Email: daniel.madden@compaq.com
Environment: VC++/VB 6.0 (SP3), Win2000, NT 4.0 (SP3)
Keywords: Encrypt, Decrypt, Dialog, MFC, ATL, VB, ASP
Level: Beginner
Description: Keep sensitive data safe via encryption
Section Miscellaneous
SubSection General
</pre>
<hr width=100% noshade>
<!-- STEP 2. Include download and sample image information -->
<li class=download><a href="CryptIt.zip">Download demo projects/source - 124 Kb </a></li>
<p><img src="CryptIt.gif" alt="CryptIt Image"></p>
<!-- STEP 3. Add the article text.-->
<p>
I saw an article (April 1999 - VCJ) by ?? Kurtz, and wrote a simple ATL (dll) to use 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 (dll), VC++ (using the dll), VB (using the dll), and ASP (using the dll)"
<p>
<p>
This was all his code (ARACrypt.cpp/h) and I just used his Class to play.
</p>
<p>
<font color=red><b><u>NOTE:</u></b></font>
<br>
<font color=blue>
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
</font>
<code>String</code>
<font color=blue>
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).
</font>
</p>
<PRE>
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
</PRE>
<p>
I hope that others find this useful.
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -