15-10-13, 02:10 PM
سلام عليكم ...اذا ممكن مساعدة انا عندي تطبيق عملي في ال vb.net لتطبيق شفرة قيصر لتشفير البيانات وما اعرف الكود الها ياريت تساعدوني لان محتاجتها في مشروع تخرجي ...ومشكورين
Public Function Encipher(ByVal plainText As String) As String
Dim cipherText As String = String.Empty
Dim cipherInChars(plainText.Length) As Char
For i As Integer = 0 To plainText.Length - 1
cipherInChars(i) = _
Convert.ToChar((Convert.ToInt32(
Convert.ToChar(plainText(i))) + Me.ShiftCount))
Next
cipherText = New String(cipherInChars)
Return cipherText
End FunctionPublic Function Decipher(ByVal cipherText As String) As String
Dim plainText As String = String.Empty
Dim cipherInChars(cipherText.Length) As Char
For i As Integer = 0 To cipherText.Length - 1
cipherInChars(i) = _
Convert.ToChar((Convert.ToInt32(
Convert.ToChar(cipherText(i))) - Me.ShiftCount))
Next
plainText = New String(cipherInChars)
Return plainText
End FunctionPublic Property ShiftCount() As Integer
Get
Return _shiftCount
End Get
Set(ByVal value As Integer)
_shiftCount = value
End Set
End Property
Public Sub New()
Me.New(3)
End Sub
Public Sub New(ByVal shiftCount As Integer)
Me.ShiftCount = shiftCount
End Sub