Cộng đồng AutoIT Việt - Autoitviet.forumvi.com
Chào mừng bạn đến với cộng đồng AutoIT Việt, hãy đăng ký một nick để cùng tham gia thảo luận nhé ^^!

Join the forum, it's quick and easy

Cộng đồng AutoIT Việt - Autoitviet.forumvi.com
Chào mừng bạn đến với cộng đồng AutoIT Việt, hãy đăng ký một nick để cùng tham gia thảo luận nhé ^^!
Cộng đồng AutoIT Việt - Autoitviet.forumvi.com
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
Latest topics
» [Code] Kiểm tra kết nối mạng
by jameseshell Fri Jul 31, 2015 3:29 pm

» AutoClick không chiếm chuột
by jameseshell Fri Jul 31, 2015 9:58 am

» [Sorf] Connect/Disconet Button
by thanhhan31 Fri Jun 26, 2015 3:56 am

» Giới thiệu ngôn ngữ lập trình Autoit
by vanhoa1402 Mon Jun 08, 2015 12:40 am

» [Code] Đếm ngược thời gian
by satoh290801 Sat Jun 06, 2015 10:11 am

» Debug game online
by cheater Mon Jun 01, 2015 3:15 pm

» [Thắc Mắc] cách nhập xuất dữ liệu
by cadilacst Mon Apr 27, 2015 7:14 am

» [Code] Auto Win 2c6f td1 - sv HN
by Hades Wed Jan 14, 2015 5:41 am

» [Hỏi] AutoIt với CSDL online?
by todzin Wed Nov 19, 2014 11:14 pm

» [Hỏi] Một số vấn đề về Copy & Paste file bằng ứng dụng thứ 3 (Everything.exe)
by aloatiso Tue Nov 11, 2014 10:31 pm

» Click theo điểm ảnh !
by nhatdaica055 Wed Oct 15, 2014 5:17 pm

» Nội quy diễn đàn
by lethusinh01 Fri Sep 12, 2014 3:59 am

» Hide Windows !!!
by Sweetsica Fri Aug 08, 2014 2:31 am

» Cài đặt , sử dụng và biên dịch Autoit
by mankichi Thu Jul 24, 2014 5:11 am

» Tuyển mod cho diễn đàn
by huynhlamid Fri Jan 17, 2014 3:36 pm

» PixelSearch - Quét (hay kiểm tra) điểm ảnh
by vanthang Fri Jan 17, 2014 5:49 am

» Thiệp Cực Đẹp Tặng Người Yêu !!!
by Nokia3G Mon Dec 23, 2013 12:50 pm

» Lấy đường dẫn của phần mềm chạy ngầm
by cuongkoken Sat Dec 21, 2013 1:25 am

» Xin Admin giup do
by xlove_bmt Wed Dec 18, 2013 6:40 am

» [Hỏi] Cần pro chỉ làm trainer game!
by quytucaca Wed May 29, 2013 7:43 am


[Soft] Mã hóa file

Go down

[Soft] Mã hóa file Empty [Soft] Mã hóa file

Bài gửi by Admin Mon Dec 17, 2012 3:16 am

Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Key.ico
#AutoIt3Wrapper_Res_Comment=Ma Hoa Tep Tin
#AutoIt3Wrapper_Res_Description=Tool ED V.1.0
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Tool ED V.1.0
#AutoIt3Wrapper_Res_Language=1066
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListBox.au3>
#include <Crypt.au3>
$CheckReg = RegRead("HKEY_CLASSES_ROOT\NewKey\DefaultIcon","")
If $CheckReg = Not @error Then
RegWrite("HKEY_CLASSES_ROOT\NewKey\DefaultIcon","","REG_SZ","Shell32.dll,47")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\NewKey\shell\Open\command","","REG_SZ",@ScriptFullPath)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.Tool","","REG_SZ","NewKey")
EndIf
IniWrite("C:\Path.ini", "path", "path", @DesktopDir)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tool ED ", 236, 321, 192, 124, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS))
$Button1 = GUICtrlCreateButton("----", 16, 16, 43, 33, $WS_GROUP)

$Input1 = GUICtrlCreateInput("", 64, 24, 153, 21)
$Input2 = GUICtrlCreateInput("", 40, 112, 153, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
$Input3 = GUICtrlCreateInput("", 40, 112, 153, 21)
GUICtrlSetState($Input3, $GUI_HIDE)
$Checkbox1 = GUICtrlCreateCheckbox("Show Password !", 40, 136, 153, 17)
GUICtrlSetCursor(-1, 3)
$List1 = GUICtrlCreateList("", 16, 160, 201, 69, -1, $WS_EX_STATICEDGE)
GUICtrlSetData(-1, "0_Algorithm Use :|RC4|3DES|DES|RC2")
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetCursor(-1, 0)
$Label1 = GUICtrlCreateLabel("Password EncryptFile :", 40, 93, 111, 17)
$Button2 = GUICtrlCreateButton("Encrypt File !", 40, 240, 161, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Decrypt File !", 40, 272, 161, 25, $WS_GROUP)
GUICtrlSetState($Button3, 144)
$Radio1 = GUICtrlCreateRadio("EncryptFile", 40, 56, 81, 17)
GUICtrlSetState($Radio1, 1)
$Radio2 = GUICtrlCreateRadio("DecryptFile", 40, 75, 81, 17)
$Icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\shell32.dll", -48, 120, 56, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_GUICtrlListBox_ClickItem($List1, 1)
Global $ThuatToan = $CALG_RC4

While 1
    Local $SavePath = ""
    $DangChon = _GUICtrlListBox_GetCurSel($List1)
    If $DangChon = 0 Then
        MsgBox(16, "Item", "Sorry ! You can not select It")
        _GUICtrlListBox_ClickItem($List1, 1)

    EndIf
    $ini2 = IniRead("C:\Path.ini", "path", "path", "")
    If GUICtrlRead($Radio1) = 1 Then

        If GUICtrlGetState($Button2) = 144 Then
            GUICtrlSetState($Button2, 80)
        ElseIf GUICtrlGetState($Button3) = 80 Then
            GUICtrlSetState($Button3, 144)
        EndIf
    ElseIf GUICtrlRead($Radio2) = 1 Then

        If GUICtrlGetState($Button3) = 144 Then
            GUICtrlSetState($Button3, 80)
        ElseIf GUICtrlGetState($Button2) = 80 Then
            GUICtrlSetState($Button2, 144)
        EndIf
    EndIf
    If GUICtrlRead($Checkbox1) = 1 Then
        GUICtrlSetData($Input2, "")
        If GUICtrlGetState($Input2) = 80 Then
            GUICtrlSetState($Input2, 96)
        ElseIf GUICtrlGetState($Input3) = 96 Then
            GUICtrlSetState($Input3, 80)
        EndIf
        GUICtrlSetData($Input2, GUICtrlRead($Input3))
    Else

        If GUICtrlGetState($Input3) = 80 Then
            GUICtrlSetState($Input3, 96)
        ElseIf GUICtrlGetState($Input2) = 96 Then
            GUICtrlSetState($Input2, 80)
        EndIf
        GUICtrlSetData($Input3, GUICtrlRead($Input2))
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            If GUICtrlRead($Radio1) = 1 Then
                $Dialog = FileOpenDialog("EncryptFile", $ini2, "All(*.*)", 1 + 2)
                GUICtrlSetData($Input1, $Dialog)
                $Dir = StringSplit($Dialog, "")
                $i = $Dir[0]
                $Len1 = StringLen($Dir[$i])
                $Len2 = StringLen($Dialog)
                $Len3 = $Len2 - $Len1
                $PathDung = StringMid($Dialog, 1, $Len3)

                IniWrite("C:\Path.ini", "path", "path", $PathDung)

            ElseIf GUICtrlRead($Radio2) = 1 Then
                $Dialog = FileOpenDialog("DecryptFile", $ini2, "File Tool(*.Tool)", 1 + 2)
                GUICtrlSetData($Input1, $Dialog)
                $Dir = StringSplit($Dialog, "")
                $i = $Dir[0]
                $Len1 = StringLen($Dir[$i])
                $Len2 = StringLen($Dialog)
                $Len3 = $Len2 - $Len1
                $PathDung = StringMid($Dialog, 1, $Len3)

                IniWrite("C:\Path.ini", "path", "path", $PathDung)

            EndIf
        Case $Button2

            $Filetoprocess = GUICtrlRead($Input1)
            $Namesave = $Filetoprocess & ".Tool"
            If GUICtrlRead($Checkbox1) = 1 Then
                $Password = GUICtrlRead($Input3)
            Else
                $Password = GUICtrlRead($Input2)
            EndIf
            _Crypt_EncryptFile($Filetoprocess, $Namesave, $Password, $ThuatToan)
            If @error Then MsgBox(16, "Error", "Erorr code " & @error)
            FileMove($Namesave, @DesktopDir)
        Case $Button3
            $Filetoprocess = GUICtrlRead($Input1)
            $s = StringSplit($Filetoprocess, ".")
            $Namesave = $s[1] & "." & $s[2]
            If GUICtrlRead($Checkbox1) = 1 Then
                $Password = GUICtrlRead($Input3)
            Else
                $Password = GUICtrlRead($Input2)
            EndIf
            If $s[2] <> "Tool" Then
            _Crypt_DecryptFile($Filetoprocess, $Namesave, $Password, $ThuatToan)
        Else
            MsgBox(16,"DecryptFile","Can not Decrypt File *.Tool"&@CRLF&"Must Have extension Number 2 Other .Tool"& @CRLF & _
"Ex : abc.exe.Tool -> File True"& @CRLF & _
      "abc.Tool -> File False")
        EndIf

            If @error Then MsgBox(16, "Error", "Erorr code " & @error)
            FileMove($Namesave, @DesktopDir)
            Switch $DangChon
                Case 1
                    $ThuatToan = $CALG_RC4
                Case 2
                    $ThuatToan = $CALG_3DES
                Case 3
                    $ThuatToan = $CALG_DES
                Case 4
                    $ThuatToan = $CALG_RC2
            EndSwitch
    EndSwitch
WEnd
Admin
Admin
Admin

Tổng số bài gửi : 63
Join date : 16/08/2011

https://autoitviet.forumvi.com

Về Đầu Trang Go down

Về Đầu Trang

- Similar topics

 
Permissions in this forum:
Bạn không có quyền trả lời bài viết