A aerobull Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-19 #1 如题,<br>用windows自带的函数,行不行?<br>给个delphi的例子,我不会C。
J jzx Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-19 #2 给你一个 vb 的例子,你把它翻译成delphi就行了,我用过的,保证没问题。<br>Public Function 数字加密(a As Long) As Long<br>Dim E As Integer<br>Dim C As Integer<br>Dim P As Integer<br>E = 1021<br>C = 1<br>P = 257<br>L1:<br>If (E = 0) Then<br> 数字加密 = C<br> Else<br>L2:<br> If (E Mod 2 = 0) Then<br> E = E / 2<br> a = (a * a) Mod P<br> GoTo L2<br> Else<br> E = E - 1<br> C = (C * a) Mod P<br> GoTo L1<br> End If<br>End If<br>End Function<br><br>Public Function 数字解密(a As Long) As Long<br>Dim D As Integer<br>Dim C As Integer<br>Dim P As Integer<br>D = 853<br>C = 1<br>P = 257<br>L1:<br>If (D = 0) Then<br> 数字解密 = C<br> Else<br>L2:<br> If (D Mod 2 = 0) Then<br> D = D / 2<br> a = (a * a) Mod P<br> GoTo L2<br> Else<br> D = D - 1<br> C = (C * a) Mod P<br> GoTo L1<br> End If<br>End If<br>End Function<br>
给你一个 vb 的例子,你把它翻译成delphi就行了,我用过的,保证没问题。<br>Public Function 数字加密(a As Long) As Long<br>Dim E As Integer<br>Dim C As Integer<br>Dim P As Integer<br>E = 1021<br>C = 1<br>P = 257<br>L1:<br>If (E = 0) Then<br> 数字加密 = C<br> Else<br>L2:<br> If (E Mod 2 = 0) Then<br> E = E / 2<br> a = (a * a) Mod P<br> GoTo L2<br> Else<br> E = E - 1<br> C = (C * a) Mod P<br> GoTo L1<br> End If<br>End If<br>End Function<br><br>Public Function 数字解密(a As Long) As Long<br>Dim D As Integer<br>Dim C As Integer<br>Dim P As Integer<br>D = 853<br>C = 1<br>P = 257<br>L1:<br>If (D = 0) Then<br> 数字解密 = C<br> Else<br>L2:<br> If (D Mod 2 = 0) Then<br> D = D / 2<br> a = (a * a) Mod P<br> GoTo L2<br> Else<br> D = D - 1<br> C = (C * a) Mod P<br> GoTo L1<br> End If<br>End If<br>End Function<br>
H htw Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-19 #4 非要用windows自带的加解密函数?它很好吗???<br>
A aerobull Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-19 #5 Microsoft CryptoAPI<br>是Microsoft公司在Windows 9x/NT平台上推出的安全加密应用体系和服务。
剑 剑知心 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-19 #6 有必要吗?为什么一定要用windows自带的加解密函数???!!!自己写一个不是更好?
A aerobull Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-20 #7 我一定要用windows自带的加解密函数,<br>知道的请出手。
L Lera Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-20 #8 to AeroBull:<br>我手头有一篇这样的文章,有人用CryptoAPI来解说WPS2000 的加密原理的,<br>如果要请EMail给我(Dxhsir@263.net)
左 左轻侯 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-21 #9 我也需要,请发给我一份<br>qinghou@china.com
W wangzheking Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-21 #11 大虾:<br> 我也很感兴趣,帮帮忙发一份给我好嘛?<br>large_sh@163.com,万分感谢
刘 刘李子 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-26 #12 API函数如下,请自己查阅相关API说明<br>//////////////////////////////////////////////////////<br>BOOL CRYPTFUNC CryptEncrypt(<br><br> HCRYPTKEY hKey, <br> HCRYPTHASH hHash, <br> BOOL Final, <br> DWORD dwFlags, <br> BYTE *pbData, <br> DWORD *pdwDataLen, <br> DWORD dwBufLen <br> <br>//////////////////////////////////////////////////////<br>BOOL CRYPTFUNC CryptDecrypt(<br><br> HCRYPTKEY hKey, <br> HCRYPTHASH hHash, <br> BOOL Final, <br> DWORD dwFlags, <br> BYTE *pbData, <br> DWORD *pdwDataLen <br> <br>/////////////////////////////////////////////////////<br>
API函数如下,请自己查阅相关API说明<br>//////////////////////////////////////////////////////<br>BOOL CRYPTFUNC CryptEncrypt(<br><br> HCRYPTKEY hKey, <br> HCRYPTHASH hHash, <br> BOOL Final, <br> DWORD dwFlags, <br> BYTE *pbData, <br> DWORD *pdwDataLen, <br> DWORD dwBufLen <br> <br>//////////////////////////////////////////////////////<br>BOOL CRYPTFUNC CryptDecrypt(<br><br> HCRYPTKEY hKey, <br> HCRYPTHASH hHash, <br> BOOL Final, <br> DWORD dwFlags, <br> BYTE *pbData, <br> DWORD *pdwDataLen <br> <br>/////////////////////////////////////////////////////<br>
T tinytao Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-28 #13 急用就自己写一个,这种字符串变形的函数也不难写。<br>如果有win API的函数,我想你也不敢用,因为谁都知道解密。
K knmfkr Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-30 #16 其实,不管什么文件都可以,比如: 可以把 ascii 码加 1,减 1 等等<br><br>很简单的