Advertisement
ASP_Volume3 Encryption #44553

CipherII

A StreamCipher encryption similar to the first 'Cipher' but now it can encrypt any text or binary file.

AI

Shrnutí 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.

Zdrojový kód
original-source
Public Function Cipher(PlainText, Secret)
Dim a, b, c
Dim pTb, cTb, cT
For i = 1 To Len(PlainText)
  pseudoi = i Mod Len(Secret)
  If pseudoi = 0 Then pseudoi = 1
  a = Mid(Secret, pseudoi, 1)
  b = Mid(Secret, pseudoi + 1, 1)
  c = Asc(a) Xor Asc(b)
  pTb = Mid(PlainText, i, 1)
  cTb = c Xor Asc(pTb)
  cT = cT + Chr(cTb)
  Form1.Label1.Caption = i
  DoEvents
Next i
EnCipher = cT
End Function
Upload
Původní komentáře (3)
Obnoveno z Wayback Machine