المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : تحويل قيم السيرفر الى خوارزمية [[ Rijndael ]]


Hacker007
08-27-16, 17:24
موضوعي اليوم هو

عمل برنامج تحويل قيم السيرفر الى خوارزمية [[ Rijndael ]] مع فنكشن فك التشفير



اولا : قم بانشاء فوم على هذا الشكل




http://c.top4top.net/p_2350bmc1.png (http://c.top4top.net/p_2350bmc1.png)

اضغط على الفورم مرتين واحذف جميع الاكواد وضع هذه الاكواد مكانها

[VB.NET] Rijndael - Pastebin.com


______________________________________



كود PHP:
Imports System.IO
Imports System.IO.Compression
Imports System.Security.Cryptography
Imports System.Text
Public Class Form1
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim OpenFileDialog As New OpenFileDialog
With OpenFileDialog
.Title = "Select EXE File"
.Filter = "Exe Files (*.exe)|*.exe"
.ShowDialog()
End With
TextBox1.Text = OpenFileDialog.FileName
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
RichTextBox1.Text = ConvertFileToBase64(TextBox1.Text)
RichTextBox1.Text = Rijndaelcrypt(RichTextBox1.Text, TextBox1.Text)
End Sub
Public Function ConvertFileToBase64(ByVal fileName As String) As String
Return Convert.ToBase64String(System.IO.File.ReadAllBytes (fileName))
End Function
Public Shared Function Rijndaelcrypt(ByVal File As String, ByVal Key As String) As Object
Dim managed As New RijndaelManaged
Dim salt As Byte() = New Byte() {1, 2, 3, 4, 5, 6, 7, 8}
Dim bytes As New Rfc2898DeriveBytes(Key, salt)
managed.Key = bytes.GetBytes(managed.Key.Length)
managed.IV = bytes.GetBytes(managed.IV.Length)
Dim stream2 As New MemoryStream
Dim stream As New CryptoStream(stream2, managed.CreateEncryptor, CryptoStreamMode.Write)
Dim buffer As Byte() = Encoding.UTF8.GetBytes(File)
stream.Write(buffer, 0, buffer.Length)
stream.Close()
File = Convert.ToBase64String(stream2.ToArray)
Return File
End Function

Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
RichTextBox1.Text = My.Resources.String1
End Sub
End Class


_____________________


اذهب الى الريسورس وضع به هذا الكود


كود PHP:
Public Shared Function RijndaelDecrypt(ByVal UDecryptU As String, ByVal UKeyU As String) As Object
Dim managed As New RijndaelManaged
Dim salt As Byte() = New Byte() { 1, 2, 3, 4, 5, 6, 7, 8 }
Dim bytes As New Rfc2898DeriveBytes(UKeyU, salt)
managed.Key = bytes.GetBytes(managed.Key.Length)
managed.IV = bytes.GetBytes(managed.IV.Length)
Dim stream2 As New MemoryStream
Dim stream As New CryptoStream(stream2, managed.CreateDecryptor, CryptoStreamMode.Write)
Try
Dim buffer As Byte() = Convert.FromBase64String(UDecryptU)
stream.Write(buffer, 0, buffer.Length)
stream.Close
UDecryptU = Encoding.UTF8.GetString(stream2.ToArray)
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
ProjectData.ClearProjectError
End Try
Return UDecryptU
End Function



اعمل حفض للمشروع واذهب افتح البرنامج واختار سيرفر وشفرة راح يحول القيم دون اي مشاكل

وكفي ذلك يإ سإدة!

دُمتم وطإبت إوقاتكم ، وحفظكم المولي من فُوفقكم ومن تحتكم