Connexion
S'inscrire
Actualités
Quoi de neuf
Activités générales
Auteurs
Forums
Nouveaux messages
Rechercher un forum
Quoi de neuf
Nouveaux messages
Nouveaux messages de profil
Activités générales
Membres
Membres inscrits
Visiteurs actuels
Nouveaux messages de profil
Rechercher dans les messages des profils
Teams
Créé ton équipe
Quoi de neuf ?
Nouveaux messages
Rechercher un forum
Menu
Connexion
S'inscrire
Install the app
Install
Forums
Forums généraux
RealityGaming
[VB.NET] LOGICIEL POUR DE/CRYPTER UNE APPLICATION DANS UNE IMAGE
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Vous utilisez un navigateur non à jour ou ancien. Il ne peut pas afficher ce site ou d'autres sites correctement.
Vous devez le mettre à jour ou utiliser un
navigateur alternatif
.
Répondre à la discussion
Message
<blockquote data-quote="Paradise'" data-source="post: 3985605" data-attributes="member: 300598"><p style="text-align: center"><strong><img src="http://imagizer.imageshack.us/v2/150x100q90/674/wPwVpv.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p> <p style="text-align: center"><strong><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">[VB.NET] LOGICIEL POUR DE/CRYPTER UNE APPLICATION DANS UNE IMAGE</span></span></strong></p><p></p><p></p><p>[tabs]</p><p>[tab=Informations concernant ce tutoriel]• <span style="color: #2C3E50"><strong>Temps</strong></span> de lecture :<span style="color: #2C3E50"><strong> 15 </strong></span>minutes.</p><p>• <span style="color: #2c3e50"><strong>Temps</strong> </span>de rédaction :<strong> <span style="color: #2c3e50">02</span> </strong>heures.</p><p>• <strong><span style="color: #2C3E50">Difficulté</span></strong> : <span style="color: #F1C40F">★★★</span></p><p>• <strong><span style="color: #2c3e50">Matériel</span></strong><span style="color: #000000"> requis : Ordinateur sous Windows XP/Vista/7/8/8.1, </span><span style="color: #2c3e50"><strong>Visual Studio</strong></span><span style="color: #000000"><strong>, </strong>Cryptexe.dll</span></p><p>• <strong><span style="color: #2C3E50">Tutoriel</span></strong> proposé par la <strong><a href="http://reality-gaming.fr/teams/good-topic-premium.43/" target="_blank"><span style="color: #2c3e50">GTP</span></a></strong>, écris par <span style="color: #2c3e50"><strong>Boosterz GTP.</strong></span></p><p>[/tab]</p><p>[tab=Téléchargements]Cryptexe.dll : <a href="http://www.mediafire.com/download/uc6ddl2o0opewee/Cryptexe.dll" target="_blank">Mediafire</a> | <a href="https://mega.co.nz/#!kN53jR5A!c1tJ6jIEI3SFYhRBz7zB3aCrmhTxALyO35Avo_pV-F0" target="_blank">Mega</a> | <a href="https://www.virustotal.com/fr/file/e5e1dbb3fe711e4b6511d96f1c6e8be8c4f76c161dd7a42be1065c4cd2f7f7f1/analysis/1409179306/" target="_blank">Virus Total</a></p><p>Je tiens à précisé les assemblys sont <strong>réalisé par moi pour vous faire gagné du temps</strong>.</p><p>Code source : <a href="https://mega.co.nz/#!8BBWSQTD!3FtJoBUXNiD3lhCfWniCx-OZQNbW9JnkJWZXLi5dm4c" target="_blank">Mega</a> | <a href="http://www.mediafire.com/download/ca6fqlvcqc586c4/WindowsApplication13.rar" target="_blank">Mediafire</a> | <a href="https://www.virustotal.com/fr/file/90e713a663c800b8c4874154980076c9fadd350802eb035f3597bdb9a3a29c74/analysis/1409179415/" target="_blank">Virus Total</a></p><p>[/Tab]</p><p>[/tabs]</p><p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><img src="https://imagizer.imageshack.us/v2/128x128q90/673/yr0hAy.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">PRÉSENTATION DU LOGICIEL.</span></span></p><p></p><p><strong><span style="color: #2c3e50">D</span></strong>onc dans ce premier chapitre je vais vous présentez le logiciel quand dans le second chapitre je vous apprendrez à créer.</p><p>Ce logiciel est une application pratique car elle permet de cacher un .exe derrière une image donc si vous avez des applications que vous ne voulez pas montrez au grand publique il est fait pour vous.</p><p>Attention si vous perdez la clef de cryptage et le mutex le logiciel sera perdu à tout jamais derrière cette image, voila pourquoi je vous conseil de tout de même le noté dans un coins de votre pc.</p><p><img src="http://i.gyazo.com/f069f6d9aea2caf2fdc07f4dcd7cd813.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Dans ce tutoriel je vous montrerez comment faire seulement la partie :</p><ul> <li data-xf-list-type="ul">Encrypt Image</li> <li data-xf-list-type="ul">Decrypt Image</li> </ul><p>Tout simplement car la partie Options est quelque chose que tout le monde peut faire avec un peu de bonne volonté.</p><p></p><p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><img src="http://imagizer.imageshack.us/v2/150x100q90/673/TN60TL.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><span style="font-family: 'Open sans condensed'"><span style="color: #2c3e50">TUTORIEL.</span></span></p><p></p><p><strong>A</strong>lors donc avant de commencé je vais vous dire le nom des items.</p><p>[SPOILER=Partie Cryptage]</p><p>Textbox de " Image Source " : src_image_2crypt</p><p>Textbox de " Image Cryptée " : crypted_output_image</p><p>Textbox de " Application " : src_file_2crypt</p><p>Textbox de " Clef de cryptage " : crypting_key</p><p>Textbox de "Mutex " : crypting_mutex</p><p>[/SPOILER]</p><p></p><p>[SPOILER=Partie Décryptage]</p><p>Textbox de " Image Cryptée " : crypted_intput_image</p><p>Textbox de " Decrypt Fichier " : decrypt_filename</p><p>Textbox de " Clef de cryptage " : crypted_key</p><p>Textbox de " Mutex " : crypted_mutex</p><p>[/SPOILER]</p><p></p><p>Donc maintenant on va passer au codage.</p><p>Vous mettez l'utilisation de Cryptexe.dll</p><p>[CODE]</p><p>Imports Cryptexe</p><p>[/CODE]</p><p>Ensuite les variables.</p><p>[CODE]</p><p> Dim SourceFNameFull, SourceFNameLite As String</p><p> Dim EncryptFNameFull, EncryptFNameLite As String</p><p> Dim OuputFNameFull As String</p><p> Dim CurrentMUTEX, CurrentKey As String</p><p>[/CODE]</p><p><img src="http://i.gyazo.com/f519de29ae9e6efc5ea458c992a0f413.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Donc ensuite on met un code à l'ouverture de l'application</p><p>[CODE]</p><p> crypting_key.Text = ByteArrayToString(MakeRandomKey(30))</p><p> crypting_mutex.Text = "MUTEX-" & random_digit(5) & "-" & random_digit(2)</p><p></p><p></p><p> CurrentMUTEX = crypting_mutex.Text</p><p> CurrentKey = crypting_key.Text</p><p> crypted_key.Text = CurrentKey</p><p> crypted_mutex.Text = CurrentMUTEX</p><p>[/CODE]</p><p><img src="http://i.gyazo.com/41a0014cccc6eaefc845f7061ba2553a.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Voila donc c'est déjà bien <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite355" alt=":)" title=":) :)" loading="lazy" data-shortname=":)" /> vous aurez quelques erreurs, ne vous en faites pas c'est de passage.</p><p>Donc ensuite on continue sur les fonctions !</p><p>La fonction Random :</p><p>[CODE]</p><p> Public Function random_string(ByVal lenght As Integer) As String</p><p> Randomize()</p><p> Dim s As New System.Text.StringBuilder("")</p><p> Dim b() As Char = "1ABCDE2FGHIJ3KLMNO4PQRST5UVWXY6Zabcd7efghi8jklmn9opqrs0tuvwxyz".ToCharArray()</p><p> For i As Integer = 1 To lenght</p><p> Randomize()</p><p> Dim z As Integer = Int(((b.Length - 2) - 0 + 1) * Rnd()) + 1</p><p> s.Append(b(z))</p><p> Next</p><p> Return s.ToString</p><p> End Function</p><p>[/CODE]</p><p><img src="http://i.gyazo.com/8af6882a5d3f64ecd6d12bf22a1b8e6f.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Donc je ne vais pas vous mettre un screen sur chaque fonction.</p><p>[Code]</p><p> Public Function random_digit(ByVal lenght As Integer) As String</p><p> Randomize()</p><p> Dim s As New System.Text.StringBuilder("")</p><p> Dim b() As Char = "1234567890".ToCharArray()</p><p> For i As Integer = 1 To lenght</p><p> Randomize()</p><p> Dim z As Integer = Int(((b.Length - 2) - 0 + 1) * Rnd()) + 1</p><p> s.Append(b(z))</p><p> Next</p><p> Return s.ToString</p><p> End Function</p><p>[/CODe]</p><p></p><p>[CODE]</p><p> Public Function StringToByteArray(ByVal TextString As String) As Byte()</p><p> Return System.Text.Encoding.Default.GetBytes(TextString)</p><p> End Function</p><p>[/CODE]</p><p></p><p>[CODE]</p><p> Public Function ByteArrayToString(ByVal TextBytes As Byte()) As String</p><p> Return System.Text.Encoding.Default.GetString(TextBytes)</p><p> End Function</p><p>[/CODE]</p><p></p><p>[CODE]</p><p> Public Function MakeRandomKey(ByVal KeyLenth As Integer) As Byte()</p><p> Return StringToByteArray(random_string(KeyLenth))</p><p> End Function</p><p>[/CODE]</p><p></p><p>Voila pour les fonctions c'est fait ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite171" alt=":D" title="Awesome face :D" loading="lazy" data-shortname=":D" /></p><p>Donc ensuite on passe aux boutons !</p><p>Donc on commence par le cryptage:</p><p>Bouton de génération d'une nouvelle clef et d'un nouveau mutex :</p><p>[CODE]</p><p> crypting_key.Text = ByteArrayToString(MakeRandomKey(30))</p><p> crypting_mutex.Text = "MUTEX-" & random_digit(5) & "-" & random_digit(2)</p><p> CurrentMUTEX = crypting_mutex.Text</p><p> CurrentKey = crypting_key.Text</p><p>[/CODE]</p><p></p><p>Bouton pour chercher les images et l'application dans votre PC :</p><p>[CODE]</p><p> Dim OFileDialog1 As New OpenFileDialog</p><p> OFileDialog1.Title = "Choisir l'image source à crypter"</p><p> OFileDialog1.Filter = "JPEG Files (.jpg)|*.jpg|PNG Files (.png)|*.png|Bitmap Files (.bmp)|*.bmp|GIF Files (.gif)|*.gif|Icon Files (.ico)|*.ico"</p><p> If Not OFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub</p><p> src_image_2crypt.Text = OFileDialog1.FileName</p><p> SourceFNameFull = OFileDialog1.FileName</p><p> SourceFNameLite = OFileDialog1.SafeFileName</p><p></p><p> Dim OFileDialog2 As New OpenFileDialog</p><p> OFileDialog2.Title = "Choisir le fichier à crypter"</p><p> OFileDialog2.Filter = "Executable Files|*.exe;*.com;*.scr|Library Files (.dll)|*.dll|All Files|*.*"</p><p> If Not OFileDialog2.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub</p><p> src_file_2crypt.Text = OFileDialog2.FileName</p><p> EncryptFNameFull = OFileDialog2.FileName</p><p> EncryptFNameLite = OFileDialog2.SafeFileName</p><p></p><p> Dim SFileDialog As New SaveFileDialog</p><p> SFileDialog.Title = "Choisir le chemin de sortie de l'image"</p><p> SFileDialog.Filter = "JPEG Files (.jpg)|*.jpg|PNG Files (.png)|*.png|Bitmap Files (.bmp)|*.bmp|GIF Files (.gif)|*.gif|Icon Files (.ico)|*.ico"</p><p> If Not SFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub</p><p> crypted_output_image.Text = SFileDialog.FileName</p><p> OuputFNameFull = SFileDialog.FileName</p><p>[/CODE]</p><p></p><p>Et le bouton pour crypté :</p><p>[CODE]</p><p> Dim src_bytes As Byte() = IO.File.ReadAllBytes(SourceFNameFull)</p><p> Dim cry_bytes As Byte() = IO.File.ReadAllBytes(EncryptFNameFull)</p><p></p><p> Dim cry_password As Byte() = StringToByteArray(crypting_key.Text)</p><p> Dim trg_body As String = String.Empty</p><p></p><p> trg_body += ByteArrayToString(src_bytes)</p><p></p><p> trg_body += crypting_mutex.Text</p><p> trg_body += ByteArrayToString(cry_password)</p><p></p><p> trg_body += crypting_mutex.Text</p><p> trg_body += EncryptFNameLite</p><p></p><p> trg_body += crypting_mutex.Text</p><p> trg_body += src_bytes.Length.ToString</p><p></p><p> trg_body += crypting_mutex.Text</p><p> trg_body += "#CRC#"</p><p></p><p> trg_body += crypting_mutex.Text</p><p> cry_bytes = Cryptexe.Cryptexe.RC4EnDeCrypt(cry_bytes, cry_password)</p><p> trg_body += ByteArrayToString(cry_bytes)</p><p></p><p> Dim trg_bytes As Byte() = StringToByteArray(trg_body)</p><p> IO.File.WriteAllBytes(OuputFNameFull, trg_bytes)</p><p></p><p> Dim msg As String = "File " & EncryptFNameLite & " succeed crypted!" & vbCrLf & vbCrLf & "Encrypted size: " & _</p><p> src_bytes.Length.ToString & " Byte(s)" & vbCrLf & crypting_mutex.Text & vbCrLf & _</p><p> "Secure Key: " & crypting_key.Text & vbCrLf & vbCrLf & _</p><p> "Crypted File: " & vbCrLf & OuputFNameFull</p><p> MsgBox(msg, MsgBoxStyle.Exclamation, "Image Crypter")</p><p>[/CODE]</p><p></p><p>Donc voila <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite171" alt=":D" title="Awesome face :D" loading="lazy" data-shortname=":D" /> Ensuite le décryptage :</p><p>Le bouton pour cherche l'image crypté et l'enregistrement :</p><p>[CODE]</p><p> If Trim(crypted_mutex.Text).Length = 0 Then Exit Sub</p><p></p><p> Dim OFileDialog As New OpenFileDialog</p><p> OFileDialog.Title = "Choix ne l'image à décrypter"</p><p> OFileDialog.Filter = "JPEG Files (.jpg)|*.jpg|PNG Files (.png)|*.png|Bitmap Files (.bmp)|*.bmp|GIF Files (.gif)|*.gif|Icon Files (.ico)|*.ico"</p><p> If Not OFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub</p><p> crypted_intput_image.Text = OFileDialog.FileName</p><p></p><p> Dim src_bytes As Byte() = IO.File.ReadAllBytes(crypted_intput_image.Text)</p><p> Dim src_text As String = ByteArrayToString(src_bytes)</p><p></p><p> Dim check_mutex = Split(src_text, crypted_mutex.Text)</p><p> If check_mutex.Length = 1 Then</p><p> decrypt_filename.Text = "Mauvais mutex ou fichier non crypter"</p><p> Exit Sub</p><p> End If</p><p></p><p> Dim check_crypted = Split(src_text, crypted_mutex.Text)(4)</p><p> If check_crypted = "#CRC#" Then</p><p> decrypt_filename.Text = Split(src_text, crypted_mutex.Text)(2) & " // " & _</p><p> Split(src_text, crypted_mutex.Text)(3) & " Byte(s)"</p><p> Else</p><p> decrypt_filename.Text = "L'image cryptée est corrompu!"</p><p> End If</p><p>[/CODE]</p><p></p><p>Et pour finir le bouton pour décrypté :</p><p>[CODE]</p><p> If Trim(decrypt_filename.Text).Length = 0 Then Exit Sub</p><p> If Trim(crypted_intput_image.Text).Length = 0 Then Exit Sub</p><p> If decrypt_filename.Text = "Mauvais mutex ou image non crypté" Then Exit Sub</p><p> If decrypt_filename.Text = "L'image est corompue" Then Exit Sub</p><p> If IO.File.Exists(crypted_intput_image.Text) = False Then Exit Sub</p><p></p><p> Dim src_bytes As Byte() = IO.File.ReadAllBytes(crypted_intput_image.Text)</p><p> Dim src_text As String = ByteArrayToString(src_bytes)</p><p></p><p> Dim key_check = Split(src_text, crypted_mutex.Text)(1)</p><p> If Not key_check = crypted_key.Text Then</p><p> MsgBox("Incorrect key!")</p><p> Exit Sub</p><p> End If</p><p></p><p> Dim SFileDialog As New SaveFileDialog</p><p> SFileDialog.Title = "Sauvegarder le logiciel"</p><p> SFileDialog.FileName = Split(src_text, crypted_mutex.Text)(2)</p><p> If Not SFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub</p><p></p><p> Dim crypted_bytes As Byte() = StringToByteArray(Split(src_text, crypted_mutex.Text)(5))</p><p> Dim decrypted_bytes As Byte() = Cryptexe.Cryptexe.RC4EnDeCrypt(crypted_bytes, StringToByteArray(crypted_key.Text))</p><p></p><p> IO.File.WriteAllBytes(SFileDialog.FileName, decrypted_bytes)</p><p> Dim msg As String = "File " & Split(src_text, crypted_mutex.Text)(2) & " succeed decrypted into:" & _</p><p> vbCrLf & SFileDialog.FileName</p><p> MsgBox(msg, MsgBoxStyle.Exclamation, "Image Crypter")</p><p>[/CODE]</p><p></p><p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407687234-finish.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">FIN DU TUTORIEL</span></span></p><p></p><p><strong><span style="color: #2c3e50">Merci à tous</span></strong><span style="color: #000000"> d'avoir lu ce tutoriel, je vous dis à très bientôt pour de </span><strong><span style="color: #2c3e50">prochains tutoriels</span></strong><span style="color: #000000"> ! <img src="/data/assets/smilies/tchuss.gif" class="smilie" loading="lazy" alt=":tchuss:" title="Tchuss :tchuss:" data-shortname=":tchuss:" /></span></p><p></p><p style="text-align: right"><span style="color: #000000">Sujet rédigé </span><u><strong><span style="color: #2c3e50">entièrement</span></strong></u><span style="color: #000000"> par </span><strong><span style="color: #2C3E50">Boosterz GTP</span></strong></p><p></p><p></p><p style="text-align: center"><span style="color: #000000"><a href="http://reality-gaming.fr/teams/good-topic-premium.43/" target="_blank"><img src="http://image.noelshack.com/fichiers/2014/32/1407687168-gtpend.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></a> </span></p></blockquote><p></p>
[QUOTE="Paradise', post: 3985605, member: 300598"] [CENTER][B][IMG]http://imagizer.imageshack.us/v2/150x100q90/674/wPwVpv.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50][VB.NET] LOGICIEL POUR DE/CRYPTER UNE APPLICATION DANS UNE IMAGE[/COLOR][/FONT][/B][/CENTER] [tabs] [tab=Informations concernant ce tutoriel]• [COLOR=#2C3E50][B]Temps[/B][/COLOR] de lecture :[COLOR=#2C3E50][B] 15 [/B][/COLOR]minutes. • [COLOR=#2c3e50][B]Temps[/B] [/COLOR]de rédaction :[B] [COLOR=#2c3e50]02[/COLOR] [/B]heures. • [B][COLOR=#2C3E50]Difficulté[/COLOR][/B] : [COLOR=#F1C40F]★★★[/COLOR] • [B][COLOR=#2c3e50]Matériel[/COLOR][/B][COLOR=#000000] requis : Ordinateur sous Windows XP/Vista/7/8/8.1, [/COLOR][COLOR=#2c3e50][B]Visual Studio[/B][/COLOR][COLOR=#000000][B], [/B]Cryptexe.dll[/COLOR] • [B][COLOR=#2C3E50]Tutoriel[/COLOR][/B] proposé par la [B][URL='http://reality-gaming.fr/teams/good-topic-premium.43/'][COLOR=#2c3e50]GTP[/COLOR][/URL][/B], écris par [COLOR=#2c3e50][B]Boosterz GTP.[/B][/COLOR] [/tab] [tab=Téléchargements]Cryptexe.dll : [URL='http://www.mediafire.com/download/uc6ddl2o0opewee/Cryptexe.dll']Mediafire[/URL] | [URL='https://mega.co.nz/#!kN53jR5A!c1tJ6jIEI3SFYhRBz7zB3aCrmhTxALyO35Avo_pV-F0']Mega[/URL] | [URL='https://www.virustotal.com/fr/file/e5e1dbb3fe711e4b6511d96f1c6e8be8c4f76c161dd7a42be1065c4cd2f7f7f1/analysis/1409179306/']Virus Total[/URL] Je tiens à précisé les assemblys sont [B]réalisé par moi pour vous faire gagné du temps[/B]. Code source : [URL='https://mega.co.nz/#!8BBWSQTD!3FtJoBUXNiD3lhCfWniCx-OZQNbW9JnkJWZXLi5dm4c']Mega[/URL] | [URL='http://www.mediafire.com/download/ca6fqlvcqc586c4/WindowsApplication13.rar']Mediafire[/URL] | [URL='https://www.virustotal.com/fr/file/90e713a663c800b8c4874154980076c9fadd350802eb035f3597bdb9a3a29c74/analysis/1409179415/']Virus Total[/URL] [/Tab] [/tabs] [CENTER][IMG]http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png[/IMG] [IMG]https://imagizer.imageshack.us/v2/128x128q90/673/yr0hAy.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50]PRÉSENTATION DU LOGICIEL.[/COLOR][/FONT][/CENTER] [B][COLOR=#2c3e50]D[/COLOR][/B]onc dans ce premier chapitre je vais vous présentez le logiciel quand dans le second chapitre je vous apprendrez à créer. Ce logiciel est une application pratique car elle permet de cacher un .exe derrière une image donc si vous avez des applications que vous ne voulez pas montrez au grand publique il est fait pour vous. Attention si vous perdez la clef de cryptage et le mutex le logiciel sera perdu à tout jamais derrière cette image, voila pourquoi je vous conseil de tout de même le noté dans un coins de votre pc. [IMG]http://i.gyazo.com/f069f6d9aea2caf2fdc07f4dcd7cd813.gif[/IMG] Dans ce tutoriel je vous montrerez comment faire seulement la partie : [LIST] [*]Encrypt Image [*]Decrypt Image [/LIST] Tout simplement car la partie Options est quelque chose que tout le monde peut faire avec un peu de bonne volonté. [CENTER][IMG]http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png[/IMG] [IMG]http://imagizer.imageshack.us/v2/150x100q90/673/TN60TL.png[/IMG] [FONT=Open sans condensed][COLOR=#2c3e50]TUTORIEL.[/COLOR][/FONT][/CENTER] [B]A[/B]lors donc avant de commencé je vais vous dire le nom des items. [SPOILER=Partie Cryptage] Textbox de " Image Source " : src_image_2crypt Textbox de " Image Cryptée " : crypted_output_image Textbox de " Application " : src_file_2crypt Textbox de " Clef de cryptage " : crypting_key Textbox de "Mutex " : crypting_mutex [/SPOILER] [SPOILER=Partie Décryptage] Textbox de " Image Cryptée " : crypted_intput_image Textbox de " Decrypt Fichier " : decrypt_filename Textbox de " Clef de cryptage " : crypted_key Textbox de " Mutex " : crypted_mutex [/SPOILER] Donc maintenant on va passer au codage. Vous mettez l'utilisation de Cryptexe.dll [CODE] Imports Cryptexe [/CODE] Ensuite les variables. [CODE] Dim SourceFNameFull, SourceFNameLite As String Dim EncryptFNameFull, EncryptFNameLite As String Dim OuputFNameFull As String Dim CurrentMUTEX, CurrentKey As String [/CODE] [IMG]http://i.gyazo.com/f519de29ae9e6efc5ea458c992a0f413.png[/IMG] Donc ensuite on met un code à l'ouverture de l'application [CODE] crypting_key.Text = ByteArrayToString(MakeRandomKey(30)) crypting_mutex.Text = "MUTEX-" & random_digit(5) & "-" & random_digit(2) CurrentMUTEX = crypting_mutex.Text CurrentKey = crypting_key.Text crypted_key.Text = CurrentKey crypted_mutex.Text = CurrentMUTEX [/CODE] [IMG]http://i.gyazo.com/41a0014cccc6eaefc845f7061ba2553a.png[/IMG] Voila donc c'est déjà bien :) vous aurez quelques erreurs, ne vous en faites pas c'est de passage. Donc ensuite on continue sur les fonctions ! La fonction Random : [CODE] Public Function random_string(ByVal lenght As Integer) As String Randomize() Dim s As New System.Text.StringBuilder("") Dim b() As Char = "1ABCDE2FGHIJ3KLMNO4PQRST5UVWXY6Zabcd7efghi8jklmn9opqrs0tuvwxyz".ToCharArray() For i As Integer = 1 To lenght Randomize() Dim z As Integer = Int(((b.Length - 2) - 0 + 1) * Rnd()) + 1 s.Append(b(z)) Next Return s.ToString End Function [/CODE] [IMG]http://i.gyazo.com/8af6882a5d3f64ecd6d12bf22a1b8e6f.png[/IMG] Donc je ne vais pas vous mettre un screen sur chaque fonction. [Code] Public Function random_digit(ByVal lenght As Integer) As String Randomize() Dim s As New System.Text.StringBuilder("") Dim b() As Char = "1234567890".ToCharArray() For i As Integer = 1 To lenght Randomize() Dim z As Integer = Int(((b.Length - 2) - 0 + 1) * Rnd()) + 1 s.Append(b(z)) Next Return s.ToString End Function [/CODe] [CODE] Public Function StringToByteArray(ByVal TextString As String) As Byte() Return System.Text.Encoding.Default.GetBytes(TextString) End Function [/CODE] [CODE] Public Function ByteArrayToString(ByVal TextBytes As Byte()) As String Return System.Text.Encoding.Default.GetString(TextBytes) End Function [/CODE] [CODE] Public Function MakeRandomKey(ByVal KeyLenth As Integer) As Byte() Return StringToByteArray(random_string(KeyLenth)) End Function [/CODE] Voila pour les fonctions c'est fait ! :D Donc ensuite on passe aux boutons ! Donc on commence par le cryptage: Bouton de génération d'une nouvelle clef et d'un nouveau mutex : [CODE] crypting_key.Text = ByteArrayToString(MakeRandomKey(30)) crypting_mutex.Text = "MUTEX-" & random_digit(5) & "-" & random_digit(2) CurrentMUTEX = crypting_mutex.Text CurrentKey = crypting_key.Text [/CODE] Bouton pour chercher les images et l'application dans votre PC : [CODE] Dim OFileDialog1 As New OpenFileDialog OFileDialog1.Title = "Choisir l'image source à crypter" OFileDialog1.Filter = "JPEG Files (.jpg)|*.jpg|PNG Files (.png)|*.png|Bitmap Files (.bmp)|*.bmp|GIF Files (.gif)|*.gif|Icon Files (.ico)|*.ico" If Not OFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub src_image_2crypt.Text = OFileDialog1.FileName SourceFNameFull = OFileDialog1.FileName SourceFNameLite = OFileDialog1.SafeFileName Dim OFileDialog2 As New OpenFileDialog OFileDialog2.Title = "Choisir le fichier à crypter" OFileDialog2.Filter = "Executable Files|*.exe;*.com;*.scr|Library Files (.dll)|*.dll|All Files|*.*" If Not OFileDialog2.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub src_file_2crypt.Text = OFileDialog2.FileName EncryptFNameFull = OFileDialog2.FileName EncryptFNameLite = OFileDialog2.SafeFileName Dim SFileDialog As New SaveFileDialog SFileDialog.Title = "Choisir le chemin de sortie de l'image" SFileDialog.Filter = "JPEG Files (.jpg)|*.jpg|PNG Files (.png)|*.png|Bitmap Files (.bmp)|*.bmp|GIF Files (.gif)|*.gif|Icon Files (.ico)|*.ico" If Not SFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub crypted_output_image.Text = SFileDialog.FileName OuputFNameFull = SFileDialog.FileName [/CODE] Et le bouton pour crypté : [CODE] Dim src_bytes As Byte() = IO.File.ReadAllBytes(SourceFNameFull) Dim cry_bytes As Byte() = IO.File.ReadAllBytes(EncryptFNameFull) Dim cry_password As Byte() = StringToByteArray(crypting_key.Text) Dim trg_body As String = String.Empty trg_body += ByteArrayToString(src_bytes) trg_body += crypting_mutex.Text trg_body += ByteArrayToString(cry_password) trg_body += crypting_mutex.Text trg_body += EncryptFNameLite trg_body += crypting_mutex.Text trg_body += src_bytes.Length.ToString trg_body += crypting_mutex.Text trg_body += "#CRC#" trg_body += crypting_mutex.Text cry_bytes = Cryptexe.Cryptexe.RC4EnDeCrypt(cry_bytes, cry_password) trg_body += ByteArrayToString(cry_bytes) Dim trg_bytes As Byte() = StringToByteArray(trg_body) IO.File.WriteAllBytes(OuputFNameFull, trg_bytes) Dim msg As String = "File " & EncryptFNameLite & " succeed crypted!" & vbCrLf & vbCrLf & "Encrypted size: " & _ src_bytes.Length.ToString & " Byte(s)" & vbCrLf & crypting_mutex.Text & vbCrLf & _ "Secure Key: " & crypting_key.Text & vbCrLf & vbCrLf & _ "Crypted File: " & vbCrLf & OuputFNameFull MsgBox(msg, MsgBoxStyle.Exclamation, "Image Crypter") [/CODE] Donc voila :D Ensuite le décryptage : Le bouton pour cherche l'image crypté et l'enregistrement : [CODE] If Trim(crypted_mutex.Text).Length = 0 Then Exit Sub Dim OFileDialog As New OpenFileDialog OFileDialog.Title = "Choix ne l'image à décrypter" OFileDialog.Filter = "JPEG Files (.jpg)|*.jpg|PNG Files (.png)|*.png|Bitmap Files (.bmp)|*.bmp|GIF Files (.gif)|*.gif|Icon Files (.ico)|*.ico" If Not OFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub crypted_intput_image.Text = OFileDialog.FileName Dim src_bytes As Byte() = IO.File.ReadAllBytes(crypted_intput_image.Text) Dim src_text As String = ByteArrayToString(src_bytes) Dim check_mutex = Split(src_text, crypted_mutex.Text) If check_mutex.Length = 1 Then decrypt_filename.Text = "Mauvais mutex ou fichier non crypter" Exit Sub End If Dim check_crypted = Split(src_text, crypted_mutex.Text)(4) If check_crypted = "#CRC#" Then decrypt_filename.Text = Split(src_text, crypted_mutex.Text)(2) & " // " & _ Split(src_text, crypted_mutex.Text)(3) & " Byte(s)" Else decrypt_filename.Text = "L'image cryptée est corrompu!" End If [/CODE] Et pour finir le bouton pour décrypté : [CODE] If Trim(decrypt_filename.Text).Length = 0 Then Exit Sub If Trim(crypted_intput_image.Text).Length = 0 Then Exit Sub If decrypt_filename.Text = "Mauvais mutex ou image non crypté" Then Exit Sub If decrypt_filename.Text = "L'image est corompue" Then Exit Sub If IO.File.Exists(crypted_intput_image.Text) = False Then Exit Sub Dim src_bytes As Byte() = IO.File.ReadAllBytes(crypted_intput_image.Text) Dim src_text As String = ByteArrayToString(src_bytes) Dim key_check = Split(src_text, crypted_mutex.Text)(1) If Not key_check = crypted_key.Text Then MsgBox("Incorrect key!") Exit Sub End If Dim SFileDialog As New SaveFileDialog SFileDialog.Title = "Sauvegarder le logiciel" SFileDialog.FileName = Split(src_text, crypted_mutex.Text)(2) If Not SFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Exit Sub Dim crypted_bytes As Byte() = StringToByteArray(Split(src_text, crypted_mutex.Text)(5)) Dim decrypted_bytes As Byte() = Cryptexe.Cryptexe.RC4EnDeCrypt(crypted_bytes, StringToByteArray(crypted_key.Text)) IO.File.WriteAllBytes(SFileDialog.FileName, decrypted_bytes) Dim msg As String = "File " & Split(src_text, crypted_mutex.Text)(2) & " succeed decrypted into:" & _ vbCrLf & SFileDialog.FileName MsgBox(msg, MsgBoxStyle.Exclamation, "Image Crypter") [/CODE] [CENTER][IMG]http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png[/IMG] [IMG]http://image.noelshack.com/fichiers/2014/32/1407687234-finish.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50]FIN DU TUTORIEL[/COLOR][/FONT][/CENTER] [B][COLOR=#2c3e50]Merci à tous[/COLOR][/B][COLOR=#000000] d'avoir lu ce tutoriel, je vous dis à très bientôt pour de [/COLOR][B][COLOR=#2c3e50]prochains tutoriels[/COLOR][/B][COLOR=#000000] ! :tchuss:[/COLOR] [RIGHT][COLOR=#000000]Sujet rédigé [/COLOR][U][B][COLOR=#2c3e50]entièrement[/COLOR][/B][/U][COLOR=#000000] par [/COLOR][B][COLOR=#2C3E50]Boosterz GTP[/COLOR][/B][/RIGHT] [CENTER][COLOR=#000000][URL='http://reality-gaming.fr/teams/good-topic-premium.43/'][IMG]http://image.noelshack.com/fichiers/2014/32/1407687168-gtpend.png[/IMG][/URL] [/COLOR][/CENTER] [/QUOTE]
Insérer les citations…
Vérification
Publier la réponse
Forums
Forums généraux
RealityGaming
[VB.NET] LOGICIEL POUR DE/CRYPTER UNE APPLICATION DANS UNE IMAGE
Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies.
Acceptez
En savoir plus.…
Haut