passwordhashing.bas
来自「比WinZip速度快很多的SINE256加密算法模块。支持指定密钥」· BAS 代码 · 共 38 行
BAS
38 行
Attribute VB_Name = "PasswordHashing"
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:2007/03/15
'描 述:SINE256加密可视化以及控制示例
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit
Public Function MakePasswordHash(pass As String) As Double 'The function that processe a number from a string
'The goal here is to mess around with the string and make it complicate
'You can make 100 page of this if you wanted to
'This value does not need to be reversed so you can make fun a long time
If pass = "" Then pass = "None"
Dim bPass() As Byte 'The password in byte (Byte array is very fast)
Dim uHold() As Double
Dim undValue As Double
undValue = 3.14159265 'lets start with Pi value... Why not :/
bPass = StrConv(pass, vbFromUnicode) 'convert the password string to byte array
Dim i As Long
ReDim uHold(0 To UBound(bPass)) 'Resize the other var
For i = 0 To UBound(bPass) 'lets start messing around
uHold(i) = (bPass(i) ^ 1.003) Mod 256687 'bleh
undValue = (undValue + ((Len(pass) / 3.1416))) Mod 18168256
undValue = (undValue + uHold(i)) Mod 16168256
undValue = undValue / Oct(Len(pass))
undValue = undValue * (Sin(i) + 1)
Next
'Well thats enuff for now
'Lets test this out ;)
MakePasswordHash = Round(undValue * (1048 / 3)) Mod 1048 'Make it a value between 0 and 255 .. i dont know why, just for fun ;)
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?