Algorithum Encryption and Decryption
This code will take text, and encrypt it in Algorithum Encryption. What it does is randomly create 4 keys, each one 1 char long. No password needed to encrypt the text, it creates its own and stores it within the encrypted text. Virtualy impossible to crack because the output encryption is rarely the same. For example, a string that says "test" will be 8 charachters long, and almost never the same. Or a string that says "testing" will be 11 charachters long. The key to encrypt and decrypt is stored at the beginning and the end of the output making it almost impossible to crack.
Riepilogo 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.
Function TEncrypt (iString) On Error GoTo uhoh Q = "" a = randomnumber(9) + 32 b = randomnumber(9) + 32 c = randomnumber(9) + 32 d = randomnumber(9) + 32 Q = Chr(a) & Chr(c) & Chr(b) e = 1 For x = 1 To Len(iString) f = Mid(iString, x, 1) If e = 1 Then Q = Q & Chr(Asc(f) + a) If e = 2 Then Q = Q & Chr(Asc(f) + c) If e = 3 Then Q = Q & Chr(Asc(f) + b) If e = 4 Then Q = Q & Chr(Asc(f) + d) e = e + 1 If e > 4 Then e = 1 Next x Q = Q & Chr(d) TEncrypt = Q Exit Function uhoh: TEncrypt = "Error: Invalid text to Encrypt" Exit Function End Function Function TDecrypt (iString) On Error GoTo uhohs Q = "" zz = Left(iString, 3) a = Left(zz, 1) b = Mid(zz, 2, 1) c = Mid(zz, 3, 1) d = Right(iString, 1) a = Int(Asc(a)) 'key 1 b = Int(Asc(b)) 'key 2 c = Int(Asc(c)) 'key 3 d = Int(Asc(d)) 'key 4 txt = Left(iString, Len(iString) - 1) txt2 = Mid(txt, 4, Len(txt)) 'encrypted text e = 1 For x = 1 To Len(txt2) f = Mid(txt2, x, 1) If e = 1 Then Q = Q & Chr(Asc(f) - a) If e = 2 Then Q = Q & Chr(Asc(f) - b) If e = 3 Then Q = Q & Chr(Asc(f) - c) If e = 4 Then Q = Q & Chr(Asc(f) - d) e = e + 1 If e > 4 Then e = 1 Next x TDecrypt = Q Exit Function uhohs: TDecrypt = "Error: Invalid text to Decrypt" Exit Function End Function Function randomnumber (finished) Randomize randomnumber = Int((Val(finished) * Rnd) + 1) End Function