This is just substitution so its more like a cipher..And it has no real use since for each letter is replaced with something massive, imagine a 12 character pass "encrypted" with this, the field in the db would have to hold like 120 characters..
Printable View
This is just substitution so its more like a cipher..And it has no real use since for each letter is replaced with something massive, imagine a 12 character pass "encrypted" with this, the field in the db would have to hold like 120 characters..
why not use a switch inside the forloop instead of all those ifs?
He could also use case instead of if. lol.
---------- Post added at 09:59 PM ---------- Previous post was at 09:56 PM ----------
I wonder.. could this be used to encrypt a file?
A good encryption system should have a password, and from that password the encryption for the text should be made. That way there is no way in hell some one can break it without threatening you :P
Still very good though :)
same in vb.net
PHP Code:Namespace qCrypt.Classes
Module Encrypt
Sub New()
End Sub
Private FinalIntegers As String
Private EncryptText As String
Private MyIntArray As Integer() = New Integer(31) {}
Public Sub StartEncryption(ByVal MyText As String)
'Uppering it just in case.
MyText = MyText.ToUpper()
'Making these strings empty.
FinalIntegers = String.Empty
EncryptText = String.Empty
'Main loop where checking each letter.
For i As Integer = 0 To MyText.Length - 1
If MyText(i) = "A" Then
EncryptText = "67147804386935659614295334925265"
End If
If MyText(i) = "B" Then
EncryptText = "40234261117512095921888831693698"
End If
If MyText(i) = "C" Then
EncryptText = "25554594088772765822059033491034"
End If
If MyText(i) = "D" Then
EncryptText = "49257666344761728762503183692300"
End If
If MyText(i) = "E" Then
EncryptText = "92345676992698286431550173278515"
End If
If MyText(i) = "F" Then
EncryptText = "93726526035464017048882091246568"
End If
If MyText(i) = "G" Then
EncryptText = "24590313462079242595407758509550"
End If
If MyText(i) = "H" Then
EncryptText = "83759930172522751880516343255280"
End If
If MyText(i) = "I" Then
EncryptText = "90291595376905753003909888385940"
End If
If MyText(i) = "K" Then
EncryptText = "37127880863226049166796151709548"
End If
If MyText(i) = "L" Then
EncryptText = "71461042420384157122852407900801"
End If
If MyText(i) = "M" Then
EncryptText = "58006678924036605768805688980313"
End If
If MyText(i) = "N" Then
EncryptText = "12447122735386729167866363617985"
End If
If MyText(i) = "O" Then
EncryptText = "36141394090474783907420403818251"
End If
If MyText(i) = "P" Then
EncryptText = "99248304649302231675368493493475"
End If
If MyText(i) = "Q" Then
EncryptText = "40735018298008298730725431001991"
End If
If MyText(i) = "R" Then
EncryptText = "81629254782078072283690311362428"
End If
If MyText(i) = "S" Then
EncryptText = "11484931118782297739315078625300"
End If
If MyText(i) = "T" Then
EncryptText = "80642658828236815024324663471131"
End If
If MyText(i) = "V" Then
EncryptText = "98185113022618718347727108401890"
End If
If MyText(i) = "W" Then
EncryptText = "64055954743088822242668717475581"
End If
If MyText(i) = "X" Then
EncryptText = "34011518510939004400504471925399"
End If
If MyText(i) = "Y" Then
EncryptText = "34044922747088848241238723934011"
End If
If MyText(i) = "Z" Then
EncryptText = "34084952747088846202261871934781"
End If
For n As Integer = 0 To 31
'Adding.
MyIntArray(n) = MyIntArray(n) + Convert.ToInt32(EncryptText(n))
'Checking if the value is more than 10.
While MyIntArray(n) > 9
MyIntArray(n) = MyIntArray(n) - 10
End While
Next
Next
'Adding everything.
For i As Integer = 0 To 31
FinalIntegers = FinalIntegers + Convert.ToString(MyIntArray(i))
'TODO - Add your own sequence here. - TODO//
Next
End Sub
'Returning encrypted text.
Public Function ReturnString() As String
Return FinalIntegers
End Function
End Module
End Namespace
hmm interesting.
i have a question though,
where it says [example]the encryption per letter or w/e if i wanted to encrypt the word "hello" would it subtract the numbers per those 5 letters? sorry for being so curious, hopefully this makes sense to you guys.