Advertisement
2002ASP Encryption #589

A function that encrypts/decrypts.

2 functions 1 that encrypts a passed variable(string) and the other decrypts the data(path of file) Mainly used for a single password. The code encrypts each character with a simple formula, the more characters the better the encryption. The limit on the password length is 50 characters.

AI

AI 요약: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

소스 코드
original-source
'simple just pass the password to it like this
'Encrypt("password")
Private Function Encrypt(varPass As String)
If Dir(path to save password to) <> "" Then: Kill "path to save password to"
Dim varEncrypt As String * 50
Dim varTmp As Double
 Open "path to save password to" For Random As #1 Len = 50
  For I = 1 To Len(varPass)
  
   varTmp = Asc(Mid$(varPass, I, 1))
   varEncrypt = Str$(((((varTmp * 1.5) / 2.1113) * 1.111119) * I))
   Put #1, I, varEncrypt
   
   
  Next I
 Close #1
End Function
'returns the decrypted pass
'like if decrypt() = "password" then
Private Function Decrypt()
Open "path to save password to" For Random As #1 Len = 50
  Dim varReturn As String * 50
  Dim varConvert As Double
  Dim varFinalPass As String
  Dim varKey As Integer
  
  
  For I = 1 To LOF(1) / 50
   
   
   Get #1, I, varReturn
   varConvert = Val(Trim(varReturn))
   varConvert = ((((varConvert / 1.5) * 2.1113) / 1.111119) / I)
   varFinalPass = varFinalPass & Chr(varConvert)
   
   
  Next I
  Decrypt = varFinalPass
 Close #1
End Function
원본 댓글 (3)
Wayback Machine에서 복구됨