diff --git a/.gitignore b/.gitignore index d65a3bc..6833395 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ #Text File -*.txt -*.md -*.log +#*.txt +#*.md +#*.log # Prerequisites *.d @@ -21,10 +21,6 @@ *.dylib *.dll -# Fortran module files -*.mod -*.smod - # Compiled Static libraries *.lai *.la @@ -35,5 +31,13 @@ *.exe *.out *.app -Binary/Release/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/cbmakefilegen-master.zip -Binary/Release/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/cbmakefilegen-master.zip + +#Ordinary compressed archives file +#*.zip +#*.zipx +#*.7z +#*.tgz +#*.tar +#*.tar.gz +#*.gz +#*.xz \ No newline at end of file diff --git a/About Not Found [Code Block Project File(cbp)].txt b/About Not Found [Code Block Project File(cbp)].txt deleted file mode 100644 index dafbfdf..0000000 --- a/About Not Found [Code Block Project File(cbp)].txt +++ /dev/null @@ -1,11 +0,0 @@ -Where's the code block project file? (*.cbp) -关于代码块项目文件,它去哪里了? (*.cbp) - -Reply: ----------- - -English -This type of file is temporarily removed. - -Chinese -这个类型的文件,暂时的被移除。 \ No newline at end of file diff --git a/Binary/Debug/EODF/Beta-Version/CUI_EncryptDecryptFile_DebugVersion-StaticDatabaseLink.exe b/Binary/Debug/EODF/Beta-Version/CUI_EncryptDecryptFile_DebugVersion-StaticDatabaseLink.exe deleted file mode 100644 index dc29151..0000000 Binary files a/Binary/Debug/EODF/Beta-Version/CUI_EncryptDecryptFile_DebugVersion-StaticDatabaseLink.exe and /dev/null differ diff --git a/Binary/Debug/EODF/Beta-Version/CUI_EncryptDecryptFile_DebugVersion.exe b/Binary/Debug/EODF/Beta-Version/CUI_EncryptDecryptFile_DebugVersion.exe deleted file mode 100644 index b71220b..0000000 Binary files a/Binary/Debug/EODF/Beta-Version/CUI_EncryptDecryptFile_DebugVersion.exe and /dev/null differ diff --git a/Binary/Debug/EODF/Beta-Version2/CUI_EncryptDecryptFile_DebugVersion2-StaticDatabaseLink.exe b/Binary/Debug/EODF/Beta-Version2/CUI_EncryptDecryptFile_DebugVersion2-StaticDatabaseLink.exe deleted file mode 100644 index 5aed771..0000000 Binary files a/Binary/Debug/EODF/Beta-Version2/CUI_EncryptDecryptFile_DebugVersion2-StaticDatabaseLink.exe and /dev/null differ diff --git a/Binary/Debug/EODF/Beta-Version2/CUI_EncryptDecryptFile_DebugVersion2.exe b/Binary/Debug/EODF/Beta-Version2/CUI_EncryptDecryptFile_DebugVersion2.exe deleted file mode 100644 index 0e76285..0000000 Binary files a/Binary/Debug/EODF/Beta-Version2/CUI_EncryptDecryptFile_DebugVersion2.exe and /dev/null differ diff --git a/Binary/Debug/EODF/Beta-Version3/CUI_EncryptDecryptFile_DebugVersion3-StaticDatabaseLink.exe b/Binary/Debug/EODF/Beta-Version3/CUI_EncryptDecryptFile_DebugVersion3-StaticDatabaseLink.exe deleted file mode 100644 index 5feb8bf..0000000 Binary files a/Binary/Debug/EODF/Beta-Version3/CUI_EncryptDecryptFile_DebugVersion3-StaticDatabaseLink.exe and /dev/null differ diff --git a/Binary/Debug/EODF/Beta-Version3/CUI_EncryptDecryptFile_DebugVersion3.exe b/Binary/Debug/EODF/Beta-Version3/CUI_EncryptDecryptFile_DebugVersion3.exe deleted file mode 100644 index e92ec74..0000000 Binary files a/Binary/Debug/EODF/Beta-Version3/CUI_EncryptDecryptFile_DebugVersion3.exe and /dev/null differ diff --git a/Binary/Release/EODF/Beta-Version/CUI_EncryptDecryptFile_BetaVersion-StaticDatabaseLink.exe b/Binary/Release/EODF/Beta-Version/CUI_EncryptDecryptFile_BetaVersion-StaticDatabaseLink.exe deleted file mode 100644 index e2773c9..0000000 Binary files a/Binary/Release/EODF/Beta-Version/CUI_EncryptDecryptFile_BetaVersion-StaticDatabaseLink.exe and /dev/null differ diff --git a/Binary/Release/EODF/Beta-Version/CUI_EncryptDecryptFile_BetaVersion.exe b/Binary/Release/EODF/Beta-Version/CUI_EncryptDecryptFile_BetaVersion.exe deleted file mode 100644 index cfb75a1..0000000 Binary files a/Binary/Release/EODF/Beta-Version/CUI_EncryptDecryptFile_BetaVersion.exe and /dev/null differ diff --git a/Binary/Release/EODF/Beta-Version2/CUI_EncryptDecryptFile_BetaVersion2-StaticDatabaseLink.exe b/Binary/Release/EODF/Beta-Version2/CUI_EncryptDecryptFile_BetaVersion2-StaticDatabaseLink.exe deleted file mode 100644 index 93d1169..0000000 Binary files a/Binary/Release/EODF/Beta-Version2/CUI_EncryptDecryptFile_BetaVersion2-StaticDatabaseLink.exe and /dev/null differ diff --git a/Binary/Release/EODF/Beta-Version2/CUI_EncryptDecryptFile_BetaVersion2.exe b/Binary/Release/EODF/Beta-Version2/CUI_EncryptDecryptFile_BetaVersion2.exe deleted file mode 100644 index 125d59b..0000000 Binary files a/Binary/Release/EODF/Beta-Version2/CUI_EncryptDecryptFile_BetaVersion2.exe and /dev/null differ diff --git a/Binary/Release/EODF/Beta-Version3/CUI_EncryptDecryptFile_BetaVersion3-StaticDatabaseLink.exe b/Binary/Release/EODF/Beta-Version3/CUI_EncryptDecryptFile_BetaVersion3-StaticDatabaseLink.exe deleted file mode 100644 index 3e87397..0000000 Binary files a/Binary/Release/EODF/Beta-Version3/CUI_EncryptDecryptFile_BetaVersion3-StaticDatabaseLink.exe and /dev/null differ diff --git a/Binary/Release/EODF/Beta-Version3/CUI_EncryptDecryptFile_BetaVersion3.exe b/Binary/Release/EODF/Beta-Version3/CUI_EncryptDecryptFile_BetaVersion3.exe deleted file mode 100644 index 14d4e0c..0000000 Binary files a/Binary/Release/EODF/Beta-Version3/CUI_EncryptDecryptFile_BetaVersion3.exe and /dev/null differ diff --git "a/Custom-Makefile-Twlilght_Yujiang/About This Directory(\345\205\263\344\272\216\350\277\231\344\270\252\347\233\256\345\275\225).md" "b/Custom-Makefile-Twlilght_Yujiang/About This Directory(\345\205\263\344\272\216\350\277\231\344\270\252\347\233\256\345\275\225).md" deleted file mode 100644 index 4bcaffa..0000000 --- "a/Custom-Makefile-Twlilght_Yujiang/About This Directory(\345\205\263\344\272\216\350\277\231\344\270\252\347\233\256\345\275\225).md" +++ /dev/null @@ -1,7 +0,0 @@ -#Information 淇℃伅 - -##This is the root directory where the (MAKEFILE) executes the compilation in this Code project. -##Request you, absolutely do not delete it! ------ -##杩欐槸涓涓紝鍦ㄨ繖涓唬鐮佸伐绋嬮噷闈㈢殑锛(MAKEFILE)鎵ц缂栬瘧鐨勬牴鐩綍銆 -##璇锋眰浣狅紝缁濆涓嶈鍒犻櫎瀹! \ No newline at end of file diff --git a/Custom-Makefile-Twlilght_Yujiang/Makefile b/Custom-Makefile-Twlilght_Yujiang/Makefile deleted file mode 100644 index 6ff07d1..0000000 --- a/Custom-Makefile-Twlilght_Yujiang/Makefile +++ /dev/null @@ -1,202 +0,0 @@ -#This File Makefile Scrpit - -#Comand Separator Tab Keyboard!!! - -include Makefile.Header - -.PHONY = all beta_version beta_version2 beta_version3 bebug_mode_version bebug_mode_version2 bebug_mode_version3 run.bat run_bebug.bat run run_bebug clean LINK_OBJECTIVE STATIC_LINKING_OBJECTIVES -all: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 01 - - - @make debug_mode_version - - @make debug_mode_version2 - - @make debug_mode_version3 - - - @make beta_version - - @make beta_version2 - - @make beta_version3 - - - -#Debug - - - -debug_mode_version: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 05 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION) -o $(DEBUG_OBJECTIVES_VERSION) - - @cls - - $(LINKING_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION) -o $(DEBUG_EXECUTE_FILE_VERSION) - - $(STATIC_LINKING_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION) -o $(DEBUG_STATIC_EXECUTE_FILE_VERSION) - -debug_mode_version2: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 06 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION2_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION2_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION2) -o $(DEBUG_OBJECTIVES_VERSION2) - - @cls - - $(LINKING_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION2) -o $(DEBUG_EXECUTE_FILE_VERSION2) - - $(STATIC_LINKING_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION2) -o $(DEBUG_STATIC_EXECUTE_FILE_VERSION2) - -debug_mode_version3: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 07 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION3_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION3_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION3) -o $(DEBUG_OBJECTIVES_VERSION3) - - @cls - - $(LINKING_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION3) -o $(DEBUG_EXECUTE_FILE_VERSION3) - - $(STATIC_LINKING_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION3) -o $(DEBUG_STATIC_EXECUTE_FILE_VERSION3) - - - -#Beta - - - -beta_version: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 02 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION) -o $(RELEASE_OBJECTIVES_VERSION) - - @cls - - $(LINKING_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION) -o $(RELEASE_EXECUTE_FILE_VERSION) - - $(STATIC_LINKING_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION) -o $(RELEASE_STATIC_EXECUTE_FILE_VERSION) - -beta_version2: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 03 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION2_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION2_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION2) -o $(RELEASE_OBJECTIVES_VERSION2) - - @cls - - $(LINKING_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION2) -o $(RELEASE_EXECUTE_FILE_VERSION2) - - $(STATIC_LINKING_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION2) -o $(RELEASE_STATIC_EXECUTE_FILE_VERSION2) - -beta_version3: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 04 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION3_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION3_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION3) -o $(RELEASE_OBJECTIVES_VERSION3) - - @cls - - $(LINKING_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION3) -o $(RELEASE_EXECUTE_FILE_VERSION3) - - $(STATIC_LINKING_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION3) -o $(RELEASE_STATIC_EXECUTE_FILE_VERSION3) - - - -#Run - - - -run.bat: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 08 - - @echo @echo off >> run.bat - - @echo.>>run.bat - - @echo cd /d $(RELEASE_EXECUTE_VERSION3_FOLDER) >> run.bat - - @echo.>>run.bat - - @echo start CUI_EncryptDecryptFile_BetaVersion3.exe >> run.bat - - start "..\\run.bat" - -run_debug.bat: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 09 - - cd /d "..\\" - - @echo @echo off >> run_debug.bat - - @echo.>>run_debug.bat - - @echo cd /d $(DEBUG_EXECUTE_VERSION3_FOLDER) >> run_debug.bat - - @echo.>>run_debug.bat - - @echo start CUI_EncryptDecryptFile_DebugVersion3.exe >> run_debug.bat - - start "..\\run_debug.bat" - -run: - - - make run.bat - -run_debug: - - - make run_debug.bat - - - -#Clean - - - -clean: - - - @cd /d "..\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 10 - - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION) - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION2) - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION3) - - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION) - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION2) - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION3) - - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION) - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION2) - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION3) - - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION) - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION2) - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION3) - - - $(DELETE) "..\\Binary\\Debug\\*.exe" - - $(DELETE) "..\\Binary\\Release\\*.exe" - - $(DELETE) "..\\Objectives\\Debug\\*.o" - - $(DELETE) "..\\Objectives\\Release\\*.o" - - - $(DELETE) "..\\run.bat" - - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) "..\\Binary\\" - - $(REMOVE_FOLDER) "..\\Objectives\\" - - - $(DELETE) "..\\run_debug.bat" diff --git a/Custom-Makefile-Twlilght_Yujiang/Makefile.Header b/Custom-Makefile-Twlilght_Yujiang/Makefile.Header deleted file mode 100644 index 37008d9..0000000 --- a/Custom-Makefile-Twlilght_Yujiang/Makefile.Header +++ /dev/null @@ -1,70 +0,0 @@ -#This File Makefile Scrpit Header - -#Workspace File - -HIDDEN_RUN_MODE=@echo off -COMMAND_WINDOW_COLOR=@color - -DELETE=@del /s /f /q -CREATE_FOLDER=@mkdir -REMOVE_FOLDER=@rmdir /s /q - -#gcc.exe -s -o -#gcc.exe -finput-charset=UTF-8 -fexec-charset=GB2312 - -MINGW_CPP=@g++ -fexec-charset=UTF-8 -Wall -O2 -c -MINGW_DEBUG_CPP=@g++ -fexec-charset=UTF-8 -Wall -fexceptions -g -c -LINKING_OBJECTIVES=g++ -s -STATIC_LINKING_OBJECTIVES=g++ -static - -#Source Code File - -SOURCES_VERSION="..\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_EODF_By_Twlilght_Yujiang.cpp" -SOURCES_VERSION2="..\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_EODF2_By_Twlilght_Yujiang.cpp" -SOURCES_VERSION3="..\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_EODF3_By_Twlilght_Yujiang.cpp" - -#Debug Configure - -DEBUG_OBJECTIVES_VERSION="..\\Objectives\\Debug\\EODF\\Beta-Version\\Main_EODF_By_Twlilght_Yujiang.o" -DEBUG_OBJECTIVES_VERSION2="..\\Objectives\\Debug\\EODF\\Beta-Version2\\Main_EODF2_By_Twlilght_Yujiang.o" -DEBUG_OBJECTIVES_VERSION3="..\\Objectives\\Debug\\EODF\\Beta-Version3\\Main_EODF3_By_Twlilght_Yujiang.o" - -DEBUG_EXECUTE_FILE_VERSION="..\\Binary\\Debug\\EODF\\Beta-Version\\CUI_EncryptDecryptFile_DebugVersion.exe" -DEBUG_EXECUTE_FILE_VERSION2="..\\Binary\\Debug\\EODF\\Beta-Version2\\CUI_EncryptDecryptFile_DebugVersion2.exe" -DEBUG_EXECUTE_FILE_VERSION3="..\\Binary\\Debug\\EODF\\Beta-Version3\\CUI_EncryptDecryptFile_DebugVersion3.exe" - -DEBUG_STATIC_EXECUTE_FILE_VERSION="..\\Binary\\Debug\\EODF\\Beta-Version\\CUI_EncryptDecryptFile_DebugVersion-StaticDatabaseLink.exe" -DEBUG_STATIC_EXECUTE_FILE_VERSION2="..\\Binary\\Debug\\EODF\\Beta-Version2\\CUI_EncryptDecryptFile_DebugVersion2-StaticDatabaseLink.exe" -DEBUG_STATIC_EXECUTE_FILE_VERSION3="..\\Binary\\Debug\\EODF\\Beta-Version3\\CUI_EncryptDecryptFile_DebugVersion3-StaticDatabaseLink.exe" - -#Release Configure - -RELEASE_OBJECTIVES_VERSION="..\\Objectives\\Release\\EODF\\Beta-Version\\Main_EODF_By_Twlilght_Yujiang.o" -RELEASE_OBJECTIVES_VERSION2="..\\Objectives\\Release\\EODF\\Beta-Version2\\Main_EODF2_By_Twlilght_Yujiang.o" -RELEASE_OBJECTIVES_VERSION3="..\\Objectives\\Release\\EODF\\Beta-Version3\\Main_EODF3_By_Twlilght_Yujiang.o" - -RELEASE_EXECUTE_FILE_VERSION="..\\Binary\\Release\\EODF\\Beta-Version\\CUI_EncryptDecryptFile_BetaVersion.exe" -RELEASE_EXECUTE_FILE_VERSION2="..\\Binary\\Release\\EODF\\Beta-Version2\\CUI_EncryptDecryptFile_BetaVersion2.exe" -RELEASE_EXECUTE_FILE_VERSION3="..\\Binary\\Release\\EODF\\Beta-Version3\\CUI_EncryptDecryptFile_BetaVersion3.exe" - -RELEASE_STATIC_EXECUTE_FILE_VERSION="..\\Binary\\Release\\EODF\\Beta-Version\\CUI_EncryptDecryptFile_BetaVersion-StaticDatabaseLink.exe" -RELEASE_STATIC_EXECUTE_FILE_VERSION2="..\\Binary\\Release\\EODF\\Beta-Version2\\CUI_EncryptDecryptFile_BetaVersion2-StaticDatabaseLink.exe" -RELEASE_STATIC_EXECUTE_FILE_VERSION3="..\\Binary\\Release\\EODF\\Beta-Version3\\CUI_EncryptDecryptFile_BetaVersion3-StaticDatabaseLink.exe" - -#Make Workspace Folder - -DEBUG_OBJECTIVES_VERSION_FOLDER="..\\Objectives\\Debug\\EODF\\Beta-Version\\" -DEBUG_OBJECTIVES_VERSION2_FOLDER="..\\Objectives\\Debug\\EODF\\Beta-Version2\\" -DEBUG_OBJECTIVES_VERSION3_FOLDER="..\\Objectives\\Debug\\EODF\\Beta-Version3\\" - -DEBUG_EXECUTE_VERSION_FOLDER="..\\Binary\\Debug\\EODF\\Beta-Version\\" -DEBUG_EXECUTE_VERSION2_FOLDER="..\\Binary\\Debug\\EODF\\Beta-Version2\\" -DEBUG_EXECUTE_VERSION3_FOLDER="..\\Binary\\Debug\\EODF\\Beta-Version3\\" - -RELEASE_OBJECTIVES_VERSION_FOLDER="..\\Objectives\\Release\\EODF\\Beta-Version\\" -RELEASE_OBJECTIVES_VERSION2_FOLDER="..\\Objectives\\Release\\EODF\\Beta-Version2\\" -RELEASE_OBJECTIVES_VERSION3_FOLDER="..\\Objectives\\Release\\EODF\\Beta-Version3\\" - -RELEASE_EXECUTE_VERSION_FOLDER="..\\Binary\\Release\\EODF\\Beta-Version\\" -RELEASE_EXECUTE_VERSION2_FOLDER="..\\Binary\\Release\\EODF\\Beta-Version2\\" -RELEASE_EXECUTE_VERSION3_FOLDER="..\\Binary\\Release\\EODF\\Beta-Version3\\" \ No newline at end of file diff --git a/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows/Makefile b/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows/Makefile deleted file mode 100644 index 13a3c1a..0000000 --- a/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows/Makefile +++ /dev/null @@ -1,166 +0,0 @@ -#This File Makefile Scrpit - -#Comand Separator Tab Keyboard!!! - -include Makefile.Header - -.PHONY = all beta_version beta_version2 beta_version3 bebug_mode_version bebug_mode_version2 bebug_mode_version3 run.bat run_bebug.bat run run_bebug clean LINK_OBJECTIVE LINK_OBJECTIVES -all: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 01 - - - @make debug_mode_version - - @make debug_mode_version2 - - @make debug_mode_version3 - - - @make beta_version - - @make beta_version2 - - @make beta_version3 - -beta_version: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 02 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION) -o $(RELEASE_OBJECTIVES_VERSION) - - $(LINK_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION) -o $(RELEASE_EXECUTE_FILE_VERSION) - -beta_version2: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 03 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION2_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION2_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION2) -o $(RELEASE_OBJECTIVES_VERSION2) - - $(LINK_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION2) -o $(RELEASE_EXECUTE_FILE_VERSION2) - -beta_version3: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 04 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION3_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION3_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION3) -o $(RELEASE_OBJECTIVES_VERSION3) - - $(LINK_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION3) -o $(RELEASE_EXECUTE_FILE_VERSION3) - -debug_mode_version: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 05 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION) -o $(DEBUG_OBJECTIVES_VERSION) - - $(LINK_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION) -o $(DEBUG_EXECUTE_FILE_VERSION) - -debug_mode_version2: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 06 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION2_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION2_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION2) -o $(DEBUG_OBJECTIVES_VERSION2) - - $(LINK_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION2) -o $(DEBUG_EXECUTE_FILE_VERSION2) - -debug_mode_version3: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 07 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION3_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION3_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION3) -o $(DEBUG_OBJECTIVES_VERSION3) - - $(LINK_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION3) -o $(DEBUG_EXECUTE_FILE_VERSION3) - -run.bat: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 08 - - @echo @echo off >> run.bat - - @echo.>>run.bat - - @echo cd /d $(RELEASE_EXECUTE_VERSION3_FOLDER) >> run.bat - - @echo.>>run.bat - - @echo start CUI_EncryptDecryptFile_BetaVersion3.exe >> run.bat - - start ".\\run.bat" - -run_debug.bat: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 09 - - cd /d ".\\" - - @echo @echo off >> run_debug.bat - - @echo.>>run_debug.bat - - @echo cd /d $(DEBUG_EXECUTE_VERSION3_FOLDER) >> run.bat - - @echo.>>run_debug.bat - - @echo start CUI_EncryptDecryptFile_DebugVersion3.exe >> run_debug.bat - - start ".\\run_debug.bat" - -run: - - - make run.bat - -run_debug: - - - make run_debug.bat - -clean: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 10 - - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION) - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION2) - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION3) - - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION) - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION2) - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION3) - - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION) - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION2) - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION3) - - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION) - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION2) - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION3) - - - $(DELETE) ".\\Binary\\Debug\\*.exe" - - $(DELETE) ".\\Binary\\Release\\*.exe" - - $(DELETE) ".\\Objectives\\Debug\\*.o" - - $(DELETE) ".\\Objectives\\Release\\*.o" - - - $(DELETE) ".\\run.bat" - - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) ".\\Binary\\" - - $(REMOVE_FOLDER) ".\\Objectives\\" - - - $(DELETE) ".\\run_debug.bat" diff --git a/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows/Makefile.Header b/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows/Makefile.Header deleted file mode 100644 index 5b13e25..0000000 --- a/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows/Makefile.Header +++ /dev/null @@ -1,52 +0,0 @@ -#This File Makefile Scrpit Header - -#Workspace File - -HIDDEN_RUN_MODE=@echo off -COMMAND_WINDOW_COLOR=@color - -DELETE=@del /s /f /q -CREATE_FOLDER=@mkdir -REMOVE_FOLDER=@rmdir /s /q - -MINGW_CPP=@g++ -Wall -O2 -c -MINGW_DEBUG_CPP=@g++ -Wall -fexceptions -g -c -LINK_OBJECTIVES=g++ -static - -SOURCES_VERSION=".\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_By_Twlilght_Yujiang.cpp" -SOURCES_VERSION2=".\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_2_By_Twlilght_Yujiang.cpp" -SOURCES_VERSION3=".\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_3_By_Twlilght_Yujiang.cpp" - -DEBUG_OBJECTIVES_VERSION=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_By_Twlilght_Yujiang.o" -DEBUG_OBJECTIVES_VERSION2=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_2_By_Twlilght_Yujiang.o" -DEBUG_OBJECTIVES_VERSION3=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_3_By_Twlilght_Yujiang.o" - -DEBUG_EXECUTE_FILE_VERSION=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\CUI_EncryptDecryptFile_DebugVersion.exe" -DEBUG_EXECUTE_FILE_VERSION2=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\CUI_EncryptDecryptFile_DebugVersion2.exe" -DEBUG_EXECUTE_FILE_VERSION3=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\CUI_EncryptDecryptFile_DebugVersion3.exe" - -RELEASE_OBJECTIVES_VERSION=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_By_Twlilght_Yujiang.o" -RELEASE_OBJECTIVES_VERSION2=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_2_By_Twlilght_Yujiang.o" -RELEASE_OBJECTIVES_VERSION3=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_3_By_Twlilght_Yujiang.o" - -RELEASE_EXECUTE_FILE_VERSION=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\CUI_EncryptDecryptFile_BetaVersion.exe" -RELEASE_EXECUTE_FILE_VERSION2=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\CUI_EncryptDecryptFile_BetaVersion2.exe" -RELEASE_EXECUTE_FILE_VERSION3=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\CUI_EncryptDecryptFile_BetaVersion3.exe" - -#Make Workspace Folder - -DEBUG_OBJECTIVES_VERSION_FOLDER=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -DEBUG_OBJECTIVES_VERSION2_FOLDER=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -DEBUG_OBJECTIVES_VERSION3_FOLDER=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" - -RELEASE_OBJECTIVES_VERSION_FOLDER=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -RELEASE_OBJECTIVES_VERSION2_FOLDER=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -RELEASE_OBJECTIVES_VERSION3_FOLDER=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" - -DEBUG_EXECUTE_VERSION_FOLDER=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -DEBUG_EXECUTE_VERSION2_FOLDER=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -DEBUG_EXECUTE_VERSION3_FOLDER=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" - -RELEASE_EXECUTE_VERSION_FOLDER=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -RELEASE_EXECUTE_VERSION2_FOLDER=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -RELEASE_EXECUTE_VERSION3_FOLDER=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" \ No newline at end of file diff --git a/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows_This-Project-Makefile.zip b/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows_This-Project-Makefile.zip deleted file mode 100644 index 35575a8..0000000 Binary files a/Custom-Makefile-Twlilght_Yujiang/Microsoft-Windows_This-Project-Makefile.zip and /dev/null differ diff --git a/EODF-history_Archive-database/Temporary-File/About this space.txt b/EODF-history_Archive-database/Temporary-File/About this space.txt new file mode 100644 index 0000000..460e637 --- /dev/null +++ b/EODF-history_Archive-database/Temporary-File/About this space.txt @@ -0,0 +1,2 @@ +属于中间过渡,临时提交阶段,正在清理所有文件 +Intermediate transition, Interim submission phase, cleaning all files \ No newline at end of file diff --git a/EODF-history_Archive-database/Temporary-File/Save temporary packages file in this directory b/EODF-history_Archive-database/Temporary-File/Save temporary packages file in this directory new file mode 100644 index 0000000..e69de29 diff --git a/EODF-history_Archive-database/Uploaded date 2017-12-30/2017-12-30 Changelog.txt b/EODF-history_Archive-database/Uploaded date 2017-12-30/2017-12-30 Changelog.txt new file mode 100644 index 0000000..ea95628 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2017-12-30/2017-12-30 Changelog.txt @@ -0,0 +1,3 @@ +1.Fix source code, Update makefile scripts +2.Update Objective and Binary file +3.Cleanup old binary and objective \ No newline at end of file diff --git a/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md b/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md new file mode 100644 index 0000000..931ed4b --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md @@ -0,0 +1,29 @@ +# Package Compressed By Twilight-Dream-Of-Magic + +----- + +## [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip (39.02 KB) + +### CRC-32 e9308eb7 +### MD5 Hash 5207cbc67eaf40ec76a0681ac23c9239 +### SHA1 Hash 287396a9eb30e01fa4a3d0cf65703f4d235a1e77 +### SHA256 Hash b3be0b57832e691d4471d5044e517eb1007349bab503ded52c35564fe78918de +### SHA512 Hash 99d6748aee021273242b1494ac8e815f00023903e86a8169d8d8ae4cf782efb218e7ceb6a16720ef011160b62b7c8e1bee74e13097d37e18ae7d4e5066874425 +### SHA3-224 Hash 0237f3aac48fd9d0a3d95e0683364eed2048b81996a9c1d31723213b +### SHA3-256 Hash 283b90a3a6dc7672cafa31606e1993dbf2b3cb6228f3dd40b75b8ab45a3b6678 +### SHA3-384 Hash 4069582ea56d27634203a7c620af557b074b603116d1fbf0e415e2af044e9cd043f856d9ee380997fad85184987f1045 +### SHA3-512 Hash dd00d7f7403b76e6c77463daff45f0ad4c22da3e1cad3e918e32422efcee30d14930fe2e043daeeee4eb506eca0f1a7cf8d225ad2d7cce2ecd4a2750f941ab59 + +----- + +##[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip (19.21 MiB) + +### CRC-32 99f6d83 +### MD5 Hash 364539b2e6b114916b5c43120801f41a +### SHA1 Hash 2fd3e937c6cbcb92e164bbb3d094e66e888897ae +### SHA256 Hash 58ccbbfd5865edeae93e8f9820dde7c64c6470bb59b8940f3aa857fd8c53b38c +### SHA512 Hash fe717da934d8374fbf08bf1ab6e151e9b9e9aa61a91445166db7d44157681cdc1fe9901d16b35dbe437b753cde2d895f2e5a8fe16e6139e95982876065fed9b2 +### SHA3-224 Hash 7a6991f58318be3ca8d6322d4b675af90308e25559329245f17a4044 +### SHA3-256 Hash 1c33f7f2ab1a690cc59752571a3bf04efd8265dd9b672e28054efb8e8e5587d8 +### SHA3-384 Hash 7dd36866536f051cffdee2ba95d1bbedc39b70100394aa89b8d6a43b0f03437ca1ebe24f02ef8ae2c2ed991b4cbd52a0 +### SHA3-512 Hash dd08e202991173c1587a2afff57cc5bb7b13f3ddb43cc32f7f515699aa1e7b05180c97121294953f070152744433162c4674f9b2060d64ea991b98340107b8f5 diff --git a/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip b/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip new file mode 100644 index 0000000..b1c9ef1 Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip b/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip new file mode 100644 index 0000000..65985af Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2017-12-30/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2017-12-30/[Github-Clone]BDP-EODF_PackageBackup.7z b/EODF-history_Archive-database/Uploaded date 2017-12-30/[Github-Clone]BDP-EODF_PackageBackup.7z new file mode 100644 index 0000000..e6513ab Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2017-12-30/[Github-Clone]BDP-EODF_PackageBackup.7z differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-01-07/2018-01-07 Changelog.txt b/EODF-history_Archive-database/Uploaded date 2018-01-07/2018-01-07 Changelog.txt new file mode 100644 index 0000000..7a345ab --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-01-07/2018-01-07 Changelog.txt @@ -0,0 +1,4 @@ +1.Repair binary file header is wrongly calculated problem +2.The module for encrypting file algorithms and decrypting file algorithms has been updated and file security is enhanced. (From the author's operation, the core code is modified) +3.Fix display text error +4.Compatibility decreases (Due to the algorithm update, [low version of the program, you can not open the file generated by the high version], [high version of the program, you can not open the low version of the generated file]. For example, you can not use (Test Beta 3.1) or later and older versions to encrypt and decrypt (Test Beta 3.1) created files and calculated files so that you will not get any useful data. Unreasonable use of program version, it is impossible.) \ No newline at end of file diff --git a/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md b/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md new file mode 100644 index 0000000..94eec07 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md @@ -0,0 +1,29 @@ +# Package Compressed By Twilight-Dream-Of-Magic + +----- + +## [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip (39.02 KB) + +### CRC-32 e9308eb7 +### MD5 Hash 5207cbc67eaf40ec76a0681ac23c9239 +### SHA1 Hash 287396a9eb30e01fa4a3d0cf65703f4d235a1e77 +### SHA256 Hash b3be0b57832e691d4471d5044e517eb1007349bab503ded52c35564fe78918de +### SHA512 Hash 99d6748aee021273242b1494ac8e815f00023903e86a8169d8d8ae4cf782efb218e7ceb6a16720ef011160b62b7c8e1bee74e13097d37e18ae7d4e5066874425 +### SHA3-224 Hash 0237f3aac48fd9d0a3d95e0683364eed2048b81996a9c1d31723213b +### SHA3-256 Hash 283b90a3a6dc7672cafa31606e1993dbf2b3cb6228f3dd40b75b8ab45a3b6678 +### SHA3-384 Hash 4069582ea56d27634203a7c620af557b074b603116d1fbf0e415e2af044e9cd043f856d9ee380997fad85184987f1045 +### SHA3-512 Hash dd00d7f7403b76e6c77463daff45f0ad4c22da3e1cad3e918e32422efcee30d14930fe2e043daeeee4eb506eca0f1a7cf8d225ad2d7cce2ecd4a2750f941ab59 + +----- + +## [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip (3.70 MiB) + +### CRC-32 8a2f88f3 +### MD5 Hash 34c13e00c485c10bbc49f0e74fdcac2a +### SHA1 Hash bb666df529fc1887b7289a9d9c3537844f51c34e +### SHA256 Hash b1ad13824dbab379188603b6980a54474391eb5f06a988f88f96d0573158b0a1 +### SHA512 Hash f34ab7b4de82aa18882c776b6f80268662643d17aff5e4d2525285dcc7b22e94a3b18b779139f396ffd941c10da4f5e93baefda6e52eccce855059bda1851654 +### SHA3-224 Hash 3dc596c5f08aedc0162ae687bc5be33b0c08651a2a379dffc4654101 +### SHA3-256 Hash 8f5c53378f2c8a7e6fbe06b4e4bcc8bdb89f7a8209108b4775742b3261522cb4 +### SHA3-384 Hash 1ac52990c87f81e6ca55f39a2118c54552df75e4656c244983b82893e86d51bdafee7d6e26bc16e2cf2d2f84e9206cb5 +### SHA3-512 Hash 49f2afd9082697b0b40910be4657f7d91e40ee7f1fee2e4443d1481ef6c4ea27fc9193d003d4a522d0d1b10e701c430c1dc6efbacee52269fdb7f3b56b02921b diff --git a/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip b/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip new file mode 100644 index 0000000..f3c614c Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip b/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip new file mode 100644 index 0000000..65985af Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-01-07/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-01-07/[Github-Clone]BDP-EODF_PackageBackup.7z b/EODF-history_Archive-database/Uploaded date 2018-01-07/[Github-Clone]BDP-EODF_PackageBackup.7z new file mode 100644 index 0000000..a5166a4 Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-01-07/[Github-Clone]BDP-EODF_PackageBackup.7z differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-04-05/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md b/EODF-history_Archive-database/Uploaded date 2018-04-05/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md new file mode 100644 index 0000000..310b1c1 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-04-05/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md @@ -0,0 +1,18 @@ +# Package Compressed By Twilight-Dream-Of-Magic + +----- + +## [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip (7.83 MiB) + +### CRC-32 c034a7fa +### MD5 Hash d18491ab8346313db0c2ab0a80c3605e +### SHA1 Hash 2a8fb37cdab4e1ee65bd089dfe0002c3f972b648 +### SHA256 Hash b10b621df05612c8311cb937ab78e3c7be009a3a004971baa843158615521fde +### SHA512 Hash 6771fc8fdf47dedfb22df4e31f0734e7fb96608a3f856a461a1ec632c3eee12ae647a88680730e7889c22900e9fd7fd9211c33c33cee3d4d3cbefad38d86d125 +### SHA3-224 Hash 0d6f16a05b1582acdc951a86537a7dbdf38575c6d036b6fbc81ce22e +### SHA3-256 Hash 00d2cc6285faee4ff49ad55fd95ba2b57b37c7fee5b6b4ad2947f923074a26f2 +### SHA3-384 Hash 5f7beaa081181343ce2c17fab934193536a3c8c480b83b8e7c3b8da0c28c6e967afc1b8060ae435756ecb4d0ba260f5d +### SHA3-512 Hash c660813f7b3f06369631d6210f0a72c19e8e2ca9499ddfeb990c84fdd9920a4090320227715f8b94d1e7156bc63b609ed2ed9c5b77c7c5739af565cce38764b9 + + +----- diff --git a/EODF-history_Archive-database/Uploaded date 2018-04-05/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-04-05].zip b/EODF-history_Archive-database/Uploaded date 2018-04-05/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-04-05].zip new file mode 100644 index 0000000..3f8752d Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-04-05/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-04-05].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-06-21/2018-06-21 Changelog.txt b/EODF-history_Archive-database/Uploaded date 2018-06-21/2018-06-21 Changelog.txt new file mode 100644 index 0000000..9b4abf6 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-06-21/2018-06-21 Changelog.txt @@ -0,0 +1 @@ +1.Simplify some source code and modify comments \ No newline at end of file diff --git a/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md b/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md new file mode 100644 index 0000000..4bbbae2 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md @@ -0,0 +1,31 @@ +# Package Compressed By Twilight-Dream-Of-Magic + +----- + +## [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-06-18].zip (38.79 KiB) + +### CRC-32 96548f1d +### MD5 Hash 08c7581eea05f12c5248f604775b6151 +### SHA1 Hash 6749cee895959b360907e8130e7574e5a74b7067 +### SHA256 Hash 288573e045925c21da2887c71c8e190e9eca791d408c6a7fac4c538c72b2d9f3 +### SHA512 Hash 41091f4a527c56c83de67e141d866d3f1481e92733a7987a6fef5b25cca526daa60ec208ded945e91126076b8b27ef0e4ea73955de90a704c84329c0144a4412 +### SHA3-224 Hash ee895bd4c54f2032e9b5680440f41b3b52f98e1ce1b6c361e73a604c +### SHA3-256 Hash 94911dce0b0a45981ff16af9e799bd60fb7fb2c9819426307bfd1fa6a479ed2b +### SHA3-384 Hash 57dee7a7effa479472f5d7d63a6d87804068668aeb893f5c0444a02e7a85894a26cf1123984de15708c94ac1fb1e2bfa +### SHA3-512 Hash 128736f0bcd5a2155abd6a40ea12e2485b55e81f8bba8c732742da849d7af88e6cf4b646ae0c7f9e8c73d9c9a8e1dd7611ffd13873006318f9fb16dc20d6b8ae + +----- + +## [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-06-21].zip (3.77 MiB) + +### CRC-32 f5ab1d30 +### MD5 Hash e480320b5f6afc56fb710a757cca36dd +### SHA1 Hash d2f4e5b23db948a9a56d527d610115afd93408c4 +### SHA256 Hash caf366616d4064040cf0483beeb4e23534bd794151fda7bcbdac235edae7a36f +### SHA512 Hash 8d7c7d604849f1fc9855687fbacfddd64cfe7f96d730fd08d76df49800f76c33f8d4a1afabc841c7ecb3e496504128516b50ac37d7967b7b8a4085b67c834c07 +### SHA3-224 Hash bae724701312b3af56c74f0811cc9cafc973ce8cc5079f74d0de7c3f +### SHA3-256 Hash 6527edd6840ee772d96a6049f8a47917df10fde90912ad54f4e702844011f833 +### SHA3-384 Hash 28c0f6447c6213dcfceda9bcdc0031241522bd78c2da8adf6c64f3caf3ddaa14973589aec2fad6dd9a26e58a9b7cd48a +### SHA3-512 Hash d862e47f8c8e752c5d0ec20cb5847c8538e63643c7daad214fd7f34cb4aa7ef4b517a3daf7487a1a11eaf31c9d7b16340e696f18fadd51b67364662019409d8b + +----- diff --git a/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-06-21].zip b/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-06-21].zip new file mode 100644 index 0000000..c20136d Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-06-21].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-06-18].zip b/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-06-18].zip new file mode 100644 index 0000000..7802ff0 Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-06-21/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-06-18].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-06-21/[Github-Clone]BDP-EODF_PackageBackup.7z b/EODF-history_Archive-database/Uploaded date 2018-06-21/[Github-Clone]BDP-EODF_PackageBackup.7z new file mode 100644 index 0000000..0871451 Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-06-21/[Github-Clone]BDP-EODF_PackageBackup.7z differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-09-10/Changelog.txt b/EODF-history_Archive-database/Uploaded date 2018-09-10/Changelog.txt new file mode 100644 index 0000000..7b8bed8 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-09-10/Changelog.txt @@ -0,0 +1,34 @@ +### This changelog copy from the git commit log and message + +## 2018-08-26 + +# From all branch + +* 1.Modify code comment and update source files + +# From new branch BDP-EODF_Source-Code-3.0_Upgrade-To-Version4.0 + +* 1.Add console command line mode from windows system project (CUI and CLI) +* 2.Test version (3.1 - 4.0) the public modify and rename is to Alpha +* 3.Source code file and binary file of Upload linux system project (CUI and CLI) +* 4.Update README.md file and create linux script, Makefile has been changed. +* 5.Please manually compile to update windows binary, because the source code was changed. + +# From old branch origin/master + +* 1.Remove the meaningless C++ language identifier, and all the text content of the function printed to the screen has been corrected and added to the string content. +* 2.Some files or folders have been renamed. +* 3.Old Makefile is deleted + +## 2018-09-10 + +# Branch: BDP-EODF_Source-Code-2.0_Upgrade-To-Version3.0 + +* 1.Modify some document from: Minor important changes: (2018-08-11) + +* 2.Recompile all BDP-EODF_Source-Code-2.0_Upgrade-To-Version3.0 binaries file from makefile script + +# Branch: BDP-EODF_Source-Code-3.0_Upgrade-To-Version4.0 + +* 1.Modify one text document file + diff --git a/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md b/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md new file mode 100644 index 0000000..b142904 --- /dev/null +++ b/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md @@ -0,0 +1,29 @@ +# Package Compressed By Twilight-Dream-Of-Magic + +----- + +## [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip (37.33 KiB) +### CRC-32 f7e51b5a +### MD5 Hash bbda2982cee43a96f9f0523ffa99cabf +### SHA1 Hash 6362258cd372b6669966f32795cbb2ef54fefe90 +### SHA256 Hash 0305fbc693158f67807f6219aa43df71e68c6f62c2804a85e06b7d7eaa45b11a +### SHA512 Hash 824b48fac5f9639e70a118ffc54d56ebe745961c6f6688c5339cc73ca030f0e8a37d6b996015ff626836047e04d83fc299e593ed1f8107399d3c2f1a91c89e53 +### SHA3-224 Hash 508759dadebe39b074099081639a68cb85d800c6a211d8ccba4fefdd +### SHA3-256 Hash c1fb006039da40005ef7fa24765f140377aadf30f4619062f0c568ba13112de8 +### SHA3-384 Hash 7645a0078b866ef1d38645d4845ab48a06765047191e119dd420479b1f5e000ffd091a2f3e265f261cd11f97a6e8d09e +### SHA3-512 Hash 69752986dcce542b504b4e8cc5530257b5c0afb44d7f85a02ad8fba9efb8fb5a65d063c7b52bc6b1b2db80afeb51c797873be77d7e549645837aab75bcbbc6cf + +----- + +## [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip (10.44 MiB) +### CRC-32 dbcfe8b7 +### MD5 Hash 3abc798822f24450493837b6bbb1a28a +### SHA1 Hash 688e91bb0b7cc917979290fe0fc360d82139bb90 +### SHA256 Hash b3a5ca20a651c1e783b93862959c2dcbfe5d6c9ff64e114191cbb5a353565650 +### SHA512 Hash b71aebf32edc1cb1b4ac5d8f4449132c5079767ae5032a8b68541d51c86d405c2f18c31c5710fc00eac651e2e6805b208ec2a1afe786e03a478211e82a48e38a +### SHA3-224 Hash f9c1678e78897686aa968fab0b31e6fb7af5b5b6ffa769ab38b978d2 +### SHA3-256 Hash d1973bfd45f0a731c7314526f78aa89ab1d081860782de4ae9188c8dfd874998 +### SHA3-384 Hash 85c1c24d8754a738bcbd06b85e5303ff73ad08be10260d0f6c3637dadbbd96b7da85bc8101b36c8907a77eca10fd7be2 +### SHA3-512 Hash 67400c8d27c1b3665d7712ea110640e68a3dbaa4a2f2029834a191941b40c76bdd641b8b9812b08438691850eba0125376eda68d757c046b4dcbae6f2d296e0b + +----- diff --git a/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip b/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip new file mode 100644 index 0000000..e28473e Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip differ diff --git a/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip b/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip new file mode 100644 index 0000000..136ed57 Binary files /dev/null and b/EODF-history_Archive-database/Uploaded date 2018-09-10/CompressedPackageFile/[Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip differ diff --git a/ErrorDebug_Source_Code/[Error]Main_DebuggingVersion.cpp b/ErrorDebug_Source_Code/[Error]Main_DebuggingVersion.cpp deleted file mode 100644 index 42acb47..0000000 --- a/ErrorDebug_Source_Code/[Error]Main_DebuggingVersion.cpp +++ /dev/null @@ -1,883 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Debugging 1.0 -源代码修改时间: 2017-8-11 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Debugging 1.0 -Source code modified by: 2017-8-11 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include -#include //C标准输入输出函数 -#include //C标准库函数 -#include //字符串处理函数 -#include - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(char *E_SFN, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TFN); -int RunDecryptFile(char *D_STN, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TFN); - -void DOSColorSet(int R,int G,int B) -{ - if(R<0) R=0; - if(R>1) R=1; - - if(G<0) G=0; - if(G>1) G=1; - - if(B<0) B=0; - if(B>1) B=1; - - if(R == 1 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); - } - else if(R == 1 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN); - } - else if(R == 1 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE); - } - else if(R == 0 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE); - } - else if(R == 1 && G == 0 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED); - } - else if(R == 0 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN); - } - else if(R == 0 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE); - } - else - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY); - } -} - -int main() -{ -ProgramMainMenu: - - string Load_User_Keyboard_Input; - - system("color 0A"); - - std :: cout << "----------" << endl; - std :: cout << "Enter 1 EncryptFile" << endl; - std :: cout << "Enter 2 DecryptFile" << endl; - std :: cout << "Enter 3 Exit Program" << endl; - std :: cout << "----------" << endl; - std :: cout << "" << endl; - std :: cout << "System:Input And Output/Enter>"; - - std :: cin >> Load_User_Keyboard_Input; - getchar(); - - if(Load_User_Keyboard_Input == "1") - { - system("cls"); - system("color 1A"); - - string E_SourceFileName, // 加密的文件名 - E_TargetFileNewName; // 加密后要保存的文件名 - - char* E_SFN; - char* E_TFN; - - //char E_TargetFileLastNameOutput = (E_TargetFileNewName + ".TY_ENCRYPTED"); //最后保存的加密后文件名 - - char E_KEY[128], //File (Encryption or Encrypted) key 文件加密密钥 - E_KEY2[128], - E_KEY3[128]; - - std :: cout << "Please input >>> the source file name.\n(Contains the directory name):" << endl; - std :: cout << "输入要加密的文件名,[C:\](含路径):" << endl; - std :: cin >> E_SourceFileName; - int String_Length = E_SourceFileName.length(); - E_SFN = (char *)malloc((String_Length+1)*sizeof(char)); - E_SourceFileName.copy(E_SFN,String_Length,0); - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥,不要输入空格:" << endl; //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - std :: cout << "Please input >>> the key,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥2,不要输入空格:" << endl; //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - std :: cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY2; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥3,不要输入空格:" << endl; //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - std :: cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY3; - - std :: cout << "\n"; - std :: cout << "Please input >>> the target file new name(Contains the directory name):" << endl; - std :: cout << "加密后的文件名(含路径):" << endl; //给加密后的文件命名,并保存 - std :: cin >> E_TargetFileNewName; - int String_Length2 = E_TargetFileNewName.length(); - E_TFN = (char *)malloc((String_Length2+1)*sizeof(char)); - E_TargetFileNewName.copy(E_TFN,String_Length2,0); - - system("cls"); - - std :: cout << "正在记录并导出,本次用于文件加密,3个密钥字符串......" << endl; - std :: cout << "Is being recorded and exported, this time for file encryption, 3 key string......" << endl; - ofstream PasswordOutputKeyFile; - PasswordOutputKeyFile.open("FILE-ENCRYPTION-DECRYPTIPN-PASSWORD.KEY.TXT"); - PasswordOutputKeyFile << "Twlilght_Yujiang File Lock Password [Key String] Save\n" << endl; - PasswordOutputKeyFile << "\n" << endl; - PasswordOutputKeyFile << "Source Input File Name and Path: " << E_SourceFileName << "\n" << endl; - PasswordOutputKeyFile << "EncryptFile: New Output Target File Name and Path: " << E_TargetFileNewName << "\n" << endl; - PasswordOutputKeyFile << "Key string1 [Password1]: " << E_KEY << "\n" << endl; - PasswordOutputKeyFile << "Key string2 [Password2]: " << E_KEY2 << "\n" << endl; - PasswordOutputKeyFile << "Key string3 [Password3]: " << E_KEY3 << "\n" << endl; - PasswordOutputKeyFile << "<******************************************************************************************>" << "\n" << endl; - PasswordOutputKeyFile.close(); - - - - std :: cout << "Please wait, read and write in the file......" << endl; - std :: cout << "请等待,文件读写中......" << endl; - getchar(); - - if(RunEncryptFile(E_SFN, E_KEY, E_KEY2, E_KEY3, E_TFN)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SFN, E_TFN); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SFN, E_TFN); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - if(Load_User_Keyboard_Input == "2") - { - system("cls"); - system("color 1A"); - - string D_SourceFileName, //源文件名 - D_TargetFileNewName; //目标文件新名称 - - char* D_SFN; - char* D_TFN; - - //char D_TargetFileLastNameOutput = (D_TargetFileNewName - ".TY_ENCRYPTED"); //最后保存的解密后文件名 - - char D_KEY[128], //File (Decryption or Decrypted) key 文件解密密钥 - D_KEY2[128], - D_KEY3[128]; - - std :: cout << "\n"; - std :: cout << "Please input >>> the source file name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "输入要解密的文件名,[C:\]不要输入空格(含路径):" << endl; - std :: cin >> D_SourceFileName; - int String_Length3 = D_SourceFileName.length(); - D_SFN = (char *)malloc((String_Length3+1)*sizeof(char)); - D_SourceFileName.copy(D_SFN,String_Length3,0); - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥,不要输入空格:" << endl; //密钥是用户自己定义的,可以随意给需要解密的文件输入密钥 - std :: cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥2,不要输入空格:" << endl; - std :: cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY2; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥3,不要输入空格:" << endl; - std :: cout << "Please input >>> the key,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY3; - - std :: cout << "\n"; - std :: cout << "Please input >>> the target file new name(Contains the directory name):" << endl; - std :: cout << "解密后的文件名,不要输入空格(含路径):" << endl; //给解密后的文件命名,并保存 - std :: cin >> D_TargetFileNewName; - int String_Length4 = D_TargetFileNewName.length(); - D_TFN = (char *)malloc((String_Length4+1)*sizeof(char)); - D_TargetFileNewName.copy(D_TFN,String_Length4,0); - - system("cls"); - - std :: cout << "Please wait, read and write in the file......" << endl; - std :: cout << "请等待,文件读写中......" << endl; - getchar(); - - if(RunDecryptFile(D_SFN, D_KEY, D_KEY2, D_KEY3, D_TFN)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SFN, D_TFN); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SFN, D_TFN); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - - if(Load_User_Keyboard_Input == "3") - { - return 0; - } - else - { - std :: cout << "User Input Error !" << endl; - getchar(); - exit(1); - } -} - - /******************************************* - * 加密文件 - * - * E_SourceFileName 要加密的文件名 - * E_KEY 密钥 - * E_TargetFileNewName 加密后要保存的文件名 - * - * @return 加密成功或失败的数字表示 - * - * 0 = 加密失败 - * 1 = 加密成功 - ********************************************/ - - int RunEncryptFile(char* E_SFN, char *E_KEY, char *E_KEY2, char *E_KEY3, char* E_TFN) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //循环次数 - KeyLength = strlen(E_KEY), //密钥的长度 - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3); - - FilePointerSource = fopen(E_SFN, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SFN); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SFN); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TFN, "wb"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", FilePointerTarget); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", FilePointerTarget); - getchar(); - return 0; - } - -/*加密算法开始*/ -//依次运行三个大型加密模块 -//Run three large encryption modules in turn - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(E_SFN); - - return 1; - } - - int RunDecryptFile(char* D_SFN, char *D_KEY, char *D_KEY2, char *D_KEY3, char* D_TFN) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //循环次数 - KeyLength = strlen(D_KEY), //密钥的长度 - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3); - - FilePointerSource = fopen(D_SFN, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SFN); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SFN); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TFN, "wb"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", FilePointerTarget); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", FilePointerTarget); - getchar(); - return 0; - } - - /******************************************* - * 解密文件 - * - * D_SourceFileName 要解密的文件名 - * D_KEY 密钥 - * D_TargetFileNewName 解密后要保存的文件名 - * - * @return 解密成功或失败的数字表示 - * - * 0 = 解密失败 - * 1 = 解密成功 - ********************************************/ - -/*解密算法开始*/ -//依次运行大型三个解密模块 -//Run three large decryption modules in turn - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } - -//string New_PlainText; //新明文 -//string New_CipherText; //新密文 - - diff --git a/File path tree.md b/File path tree.md new file mode 100644 index 0000000..db31431 --- /dev/null +++ b/File path tree.md @@ -0,0 +1,55 @@ +# Show path tree and file tree + +EODF-history_Archive-database the path content + +``` +./ +鈹 .gitignore +鈹 File path tree.md +鈹 LICENSE +鈹 README.md +鈹 +鈹斺攢EODF-history_Archive-database + 鈹溾攢Temporary-File + 鈹 About this space.txt + 鈹 Save temporary packages file in this directory + 鈹 + 鈹溾攢Uploaded date 2017-12-30 + 鈹 鈹 2017-12-30 Changelog.txt + 鈹 鈹 [Github-Clone]BDP-EODF_PackageBackup.7z + 鈹 鈹 + 鈹 鈹斺攢CompressedPackageFile + 鈹 [File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md + 鈹 [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip + 鈹 [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2017-12-30].zip + 鈹 + 鈹溾攢Uploaded date 2018-01-07 + 鈹 鈹 2018-01-07 Changelog.txt + 鈹 鈹 [Github-Clone]BDP-EODF_PackageBackup.7z + 鈹 鈹 + 鈹 鈹斺攢CompressedPackageFile + 鈹 [File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md + 鈹 [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip + 鈹 [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-01-07].zip + 鈹 + 鈹溾攢Uploaded date 2018-04-05 + 鈹 [File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md + 鈹 [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-04-05].zip + 鈹 + 鈹溾攢Uploaded date 2018-06-21 + 鈹 鈹 2018-06-21 Changelog.txt + 鈹 鈹 [Github-Clone]BDP-EODF_PackageBackup.7z + 鈹 鈹 + 鈹 鈹斺攢CompressedPackageFile + 鈹 [File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md + 鈹 [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-06-21].zip + 鈹 [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-06-18].zip + 鈹 + 鈹斺攢Uploaded date 2018-09-10 + 鈹 Changelog.txt + 鈹 + 鈹斺攢CompressedPackageFile + [File Hash]BackDoorProgram-Encrypt_Or_Decrypt_File.md + [Github-Branches]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip + [Github-Master]BackDoorProgram-EncryptOrDecryptFile[2018-09-10].zip +``` diff --git a/Makefile b/Makefile deleted file mode 100644 index 9571086..0000000 --- a/Makefile +++ /dev/null @@ -1,183 +0,0 @@ -#This File Makefile Scrpit - -#Comand Separator Tab Keyboard!!! - -include Makefile.Header - -.PHONY=all beta_version beta_version2 beta_version3 bebug_mode_version bebug_mode_version2 bebug_mode_version3 run.bat run_bebug.bat run run_bebug clean help LINK_OBJECTIVE LINK_OBJECTIVES - -all: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 01 - - - @make debug_mode_version - - @make debug_mode_version2 - - @make debug_mode_version3 - - - @make beta_version - - @make beta_version2 - - @make beta_version3 - -beta_version: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 02 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION) -o $(RELEASE_OBJECTIVES_VERSION) - - $(LINK_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION) -o $(RELEASE_EXECUTE_FILE_VERSION) - -beta_version2: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 03 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION2_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION2_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION2) -o $(RELEASE_OBJECTIVES_VERSION2) - - $(LINK_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION2) -o $(RELEASE_EXECUTE_FILE_VERSION2) - -beta_version3: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 04 - - - $(CREATE_FOLDER) $(RELEASE_OBJECTIVES_VERSION3_FOLDER) - - $(CREATE_FOLDER) $(RELEASE_EXECUTE_VERSION3_FOLDER) - - $(MINGW_CPP) -Wall -O2 -c $(SOURCES_VERSION3) -o $(RELEASE_OBJECTIVES_VERSION3) - - $(LINK_OBJECTIVES) $(RELEASE_OBJECTIVES_VERSION3) -o $(RELEASE_EXECUTE_FILE_VERSION3) - -debug_mode_version: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 05 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION) -o $(DEBUG_OBJECTIVES_VERSION) - - $(LINK_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION) -o $(DEBUG_EXECUTE_FILE_VERSION) - -debug_mode_version2: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 06 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION2_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION2_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION2) -o $(DEBUG_OBJECTIVES_VERSION2) - - $(LINK_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION2) -o $(DEBUG_EXECUTE_FILE_VERSION2) - -debug_mode_version3: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 07 - - - $(CREATE_FOLDER) $(DEBUG_OBJECTIVES_VERSION3_FOLDER) - - $(CREATE_FOLDER) $(DEBUG_EXECUTE_VERSION3_FOLDER) - - $(MINGW_DEBUG_CPP) $(SOURCES_VERSION3) -o $(DEBUG_OBJECTIVES_VERSION3) - - $(LINK_OBJECTIVES) $(DEBUG_OBJECTIVES_VERSION3) -o $(DEBUG_EXECUTE_FILE_VERSION3) - -run.bat: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 08 - - @echo @echo off >> run.bat - - @echo.>>run.bat - - @echo cd /d $(RELEASE_EXECUTE_VERSION3_FOLDER) >> run.bat - - @echo.>>run.bat - - @echo start CUI_EncryptDecryptFile_BetaVersion3.exe >> run.bat - - start ".\\run.bat" - -run_debug.bat: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 09 - - cd /d ".\\" - - @echo @echo off >> run_debug.bat - - @echo.>>run_debug.bat - - @echo cd /d $(DEBUG_EXECUTE_VERSION3_FOLDER) >> run.bat - - @echo.>>run_debug.bat - - @echo start CUI_EncryptDecryptFile_DebugVersion3.exe >> run_debug.bat - - start ".\\run_debug.bat" - -run: - - - make run.bat - -run_debug: - - - make run_debug.bat - -clean: - - - @cd /d ".\\" - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 10 - - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION) - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION2) - - $(DELETE) $(DEBUG_OBJECTIVES_VERSION3) - - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION) - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION2) - - $(DELETE) $(DEBUG_EXECUTE_FILE_VERSION3) - - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION) - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION2) - - $(DELETE) $(RELEASE_OBJECTIVES_VERSION3) - - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION) - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION2) - - $(DELETE) $(RELEASE_EXECUTE_FILE_VERSION3) - - - $(DELETE) ".\\Binary\\Debug\\*.exe" - - $(DELETE) ".\\Binary\\Release\\*.exe" - - $(DELETE) ".\\Objectives\\Debug\\*.o" - - $(DELETE) ".\\Objectives\\Release\\*.o" - - - $(DELETE) ".\\run.bat" - - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_OBJECTIVES_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_OBJECTIVES_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(DEBUG_EXECUTE_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION2_FOLDER) - - $(REMOVE_FOLDER) $(RELEASE_EXECUTE_VERSION3_FOLDER) - - - $(REMOVE_FOLDER) ".\\Binary\\" - - $(REMOVE_FOLDER) ".\\Objectives\\" - - - $(DELETE) ".\\run_debug.bat" - -help: - - - $(HIDDEN_RUN_MODE) - - $(COMMAND_WINDOW_COLOR) 11 - - @echo make all - - @echo make debug_mode_version (debug) - - @echo make debug_mode_version2 (debug) - - @echo make debug_mode_version3 (debug) - - @echo make beta_version (release) - - @echo make beta_version2 (release) - - @echo make beta_version3 (release) - - @echo make run - - @echo make run_debug - - @echo make clean - - @echo make help \ No newline at end of file diff --git a/Makefile-CbpToMakefileTools/Makefile b/Makefile-CbpToMakefileTools/Makefile deleted file mode 100644 index 51f4e53..0000000 --- a/Makefile-CbpToMakefileTools/Makefile +++ /dev/null @@ -1,109 +0,0 @@ -#------------------------------------------------------------------------------# -# This makefile was generated by 'cbp2make' tool rev.147 # -#------------------------------------------------------------------------------# - -WORKDIR = %cd% - -CC = gcc.exe -CXX = g++.exe -AR = ar.exe -LD = g++.exe -WINDRES = windres.exe - -INC = -CFLAGS = -Wall -fexceptions -RESINC = -LIBDIR = -LIB = -LDFLAGS = - -INC_DEBUG = $(INC) -CFLAGS_DEBUG = $(CFLAGS) -g -RESINC_DEBUG = $(RESINC) -RCFLAGS_DEBUG = $(RCFLAGS) -LIBDIR_DEBUG = $(LIBDIR) -LIB_DEBUG = $(LIB) -LDFLAGS_DEBUG = $(LDFLAGS) -OBJDIR_DEBUG = ".\\Objectives\\Debug -DEP_DEBUG = -OUT_DEBUG = ".\\Binary\\Debug\\BackDoorProgram-Encrypt_Or_Decrypt_File.exe" - -INC_RELEASE = $(INC) -CFLAGS_RELEASE = $(CFLAGS) -O2 -RESINC_RELEASE = $(RESINC) -RCFLAGS_RELEASE = $(RCFLAGS) -LIBDIR_RELEASE = $(LIBDIR) -LIB_RELEASE = $(LIB) -LDFLAGS_RELEASE = $(LDFLAGS) -s -OBJDIR_RELEASE = ".\\Objectives\\Release -DEP_RELEASE = -OUT_RELEASE = ".\\Binary\\Release\\BackDoorProgram-Encrypt_Or_Decrypt_File.exe" - -OBJ_DEBUG = ".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.o" ".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.o" $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.o" - -OBJ_RELEASE = ".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.o" ".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.o" $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.o" - -all: debug release - -clean: clean_debug clean_release - -before_debug: - cmd /c if not exist Binary\\Debug mkdir Binary\\Debug - cmd /c if not exist ".\\Objectives\\Debug)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version" mkdir $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version" - cmd /c if not exist ".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2" mkdir $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2" - cmd /c if not exist ".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3" mkdir $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3" - -after_debug: - -debug: before_debug out_debug after_debug - -out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) - $(LD) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) $(LIB_DEBUG) - -$(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.o: [Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ".\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.cpp" -o $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.o" - -$(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.o: [Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ".\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.cpp" -o $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.o" - -$(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.o: [Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ".\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.cpp" -o $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.o" - -clean_debug: - cmd /c del /f $(OBJ_DEBUG) $(OUT_DEBUG) - cmd /c rmdir /s /q Binary\\Debug - cmd /c rmdir /s /q $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version" - cmd /c rmdir /s /q $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2" - cmd /c rmdir /s /q $(OBJDIR_DEBUG)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3" - -before_release: - cmd /c if not exist Binary\\Release mkdir Binary\\Release - cmd /c if not exist ".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version" mkdir $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version" - cmd /c if not exist ".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2" mkdir $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2" - cmd /c if not exist ".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3" mkdir $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3" - -after_release: - -release: before_release out_release after_release - -out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) - $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) - -$(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.o: [Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ".\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.cpp" -o $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version\\Main By Twlilght_Yujiang.o" - -$(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.o: [Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ".\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.cpp" -o $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2\\Main_2 By Twlilght_Yujiang.o" - -$(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.o: [Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ".\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.cpp" -o $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3\\Main_3 By Twlilght_Yujiang.o" - -clean_release: - cmd /c del /f $(OBJ_RELEASE) $(OUT_RELEASE) - cmd /c rmdir /s /q Binary\\Release - cmd /c rmdir /s /q $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version" - cmd /c rmdir /s /q $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version2" - cmd /c rmdir /s /q $(OBJDIR_RELEASE)\\[Encrypt_Or_Decrypt_File] Source Code\\Beta Version3" - -.PHONY: before_debug after_debug clean_debug before_release after_release clean_release - diff --git a/Makefile.Header b/Makefile.Header deleted file mode 100644 index b39302d..0000000 --- a/Makefile.Header +++ /dev/null @@ -1,52 +0,0 @@ -#This File Makefile Scrpit Header - -#Workspace File - -HIDDEN_RUN_MODE=@echo off -COMMAND_WINDOW_COLOR=@color - -DELETE=@del /s /f /q -CREATE_FOLDER=@mkdir -REMOVE_FOLDER=@rmdir /s /q - -MINGW_CPP=@g++ -Wall -O2 -c -MINGW_DEBUG_CPP=@g++ -Wall -fexceptions -g -c -LINK_OBJECTIVES=@g++ -static - -SOURCES_VERSION=".\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_By_Twlilght_Yujiang.cpp" -SOURCES_VERSION2=".\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_2_By_Twlilght_Yujiang.cpp" -SOURCES_VERSION3=".\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_3_By_Twlilght_Yujiang.cpp" - -DEBUG_OBJECTIVES_VERSION=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_By_Twlilght_Yujiang.o" -DEBUG_OBJECTIVES_VERSION2=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_2_By_Twlilght_Yujiang.o" -DEBUG_OBJECTIVES_VERSION3=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_3_By_Twlilght_Yujiang.o" - -DEBUG_EXECUTE_FILE_VERSION=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\CUI_EncryptDecryptFile_DebugVersion.exe" -DEBUG_EXECUTE_FILE_VERSION2=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\CUI_EncryptDecryptFile_DebugVersion2.exe" -DEBUG_EXECUTE_FILE_VERSION3=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\CUI_EncryptDecryptFile_DebugVersion3.exe" - -RELEASE_OBJECTIVES_VERSION=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\Main_By_Twlilght_Yujiang.o" -RELEASE_OBJECTIVES_VERSION2=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\Main_2_By_Twlilght_Yujiang.o" -RELEASE_OBJECTIVES_VERSION3=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\Main_3_By_Twlilght_Yujiang.o" - -RELEASE_EXECUTE_FILE_VERSION=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\CUI_EncryptDecryptFile_BetaVersion.exe" -RELEASE_EXECUTE_FILE_VERSION2=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\CUI_EncryptDecryptFile_BetaVersion2.exe" -RELEASE_EXECUTE_FILE_VERSION3=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\CUI_EncryptDecryptFile_BetaVersion3.exe" - -#Make Workspace Folder - -DEBUG_OBJECTIVES_VERSION_FOLDER=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -DEBUG_OBJECTIVES_VERSION2_FOLDER=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -DEBUG_OBJECTIVES_VERSION3_FOLDER=".\\Objectives\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" - -RELEASE_OBJECTIVES_VERSION_FOLDER=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -RELEASE_OBJECTIVES_VERSION2_FOLDER=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -RELEASE_OBJECTIVES_VERSION3_FOLDER=".\\Objectives\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" - -DEBUG_EXECUTE_VERSION_FOLDER=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -DEBUG_EXECUTE_VERSION2_FOLDER=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -DEBUG_EXECUTE_VERSION3_FOLDER=".\\Binary\\Debug\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" - -RELEASE_EXECUTE_VERSION_FOLDER=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version\\" -RELEASE_EXECUTE_VERSION2_FOLDER=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version2\\" -RELEASE_EXECUTE_VERSION3_FOLDER=".\\Binary\\Release\\[Encrypt_Or_Decrypt_File]-Source-Code\\Beta-Version3\\" diff --git a/Objectives/Debug/EODF/Beta-Version/Main_EODF_By_Twlilght_Yujiang.o b/Objectives/Debug/EODF/Beta-Version/Main_EODF_By_Twlilght_Yujiang.o deleted file mode 100644 index 2a22f65..0000000 Binary files a/Objectives/Debug/EODF/Beta-Version/Main_EODF_By_Twlilght_Yujiang.o and /dev/null differ diff --git a/Objectives/Debug/EODF/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.o b/Objectives/Debug/EODF/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.o deleted file mode 100644 index 2735480..0000000 Binary files a/Objectives/Debug/EODF/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.o and /dev/null differ diff --git a/Objectives/Debug/EODF/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.o b/Objectives/Debug/EODF/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.o deleted file mode 100644 index a39c064..0000000 Binary files a/Objectives/Debug/EODF/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.o and /dev/null differ diff --git a/Objectives/Release/EODF/Beta-Version/Main_EODF_By_Twlilght_Yujiang.o b/Objectives/Release/EODF/Beta-Version/Main_EODF_By_Twlilght_Yujiang.o deleted file mode 100644 index 4480284..0000000 Binary files a/Objectives/Release/EODF/Beta-Version/Main_EODF_By_Twlilght_Yujiang.o and /dev/null differ diff --git a/Objectives/Release/EODF/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.o b/Objectives/Release/EODF/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.o deleted file mode 100644 index 56122b5..0000000 Binary files a/Objectives/Release/EODF/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.o and /dev/null differ diff --git a/Objectives/Release/EODF/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.o b/Objectives/Release/EODF/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.o deleted file mode 100644 index 7226071..0000000 Binary files a/Objectives/Release/EODF/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.o and /dev/null differ diff --git a/README.md b/README.md index 46cd60c..347fcad 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,16 @@ ------------------------------------------------------------------------------------------------------------------------- - -English - -1.At present this procedure, only need to do some landscaping, as well as detailed adjustments to the manual. - -2.Do not need to do much change. - -3.Of course, if you need to change it. Give me a better suggestion, let me write this procedure. - - - -This code repository consists of [Twlilght-Dream-Of-Magic] Twlilght_Yujiang author, compiled and built! - -IDE: Integrated development environment - -It is best not to use Code Block IDE, to build this project! - -Although i provided the [* .cbp] file! (Code Block Project File) - - - -Best to use Makefile build project! - -If you need to view my Makefile help, the command line input [make help]. - -This Makefile file - -Applicable to (Microsoft Windows) system (already completed, the code has BUG please Github message) - -Applicable to (Linux) system (still in plan .......) - - - -If you want to use the IDE to build this project, please distinguish between each version! - -This warehouse, each version of the project folder, please create a new IDE project file, and then associated! - ------------------------------------------------------------------------------------------------------------------------- - -Chinese - -1.目前这个程序,只需要做一些美化,还有说明书的详细调整。 - -2.不需要做什么太大的改动。 - -3.当然,如果你需要改动的话。给我更好的建议,让我去编写这个程序。 - - - -这个代码仓库由 [Twlilght-Dream-Of-Magic] Twlilght_Yujiang 作者,编译和构建! - -IDE : 集成开发环境 - -最好不要使用Code Block IDE,来构建这个工程! - -虽然我提供了[*.cbp]文件!(Code Block Project File) - - - -最好使用Makefile构建工程! - -如果需要,查看我的Makefile帮助,命令行输入[make help] - -这个Makefile文件 - -适用于(Microsoft Windows)系统 (已经完成,代码有BUG请在Github上留言) - -适用于(Linux)系统 (还在计划中.......) - - - -如果你要使用IDE构建这个工程,请区分每一个版本! - -这个仓库,每一个版本的工程文件夹,请新建一个IDE工程文件,然后关联! - ------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------------------------------------ + +English + +This is BackDoorProgram-EncryptOrDecryptFile the Backup (Compressed Packages Archive Database) +The power of this repository is about github support + +------------------------------------------------------------------------------------------------------------------------ + +Chinese + +这是BackDoorProgram-EncryptOrDecryptFile的备份(压缩包档案数据库) +这个仓库的权力 ,是关于Github的提供支持 + + +------------------------------------------------------------------------------------------------------------------------ diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/EODF_By_Twlilght_Yujiang.hpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/EODF_By_Twlilght_Yujiang.hpp deleted file mode 100644 index 3e621d1..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/EODF_By_Twlilght_Yujiang.hpp +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************* -* 加密文件 -* -* E_SourceFileName 要加密的文件名 -* E_KEY 密钥 -* E_TargetFileNewName 加密后要保存的文件名 -* -* @return 加密成功或失败的数字表示 -* -* 0 = 加密失败 -* 1 = 加密成功 -********************************************/ - - int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //循环次数 - KeyLength = strlen(E_KEY), //密钥的长度 - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3); - - FilePointerSource = fopen(E_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource== NULL) - { - printf("file[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget== NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", FilePointerTarget); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", FilePointerTarget); - getchar(); - return 0; - } -/*加密算法开始*/ - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } - - int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //循环次数 - KeyLength = strlen(D_KEY), //密钥的长度 - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3); - - FilePointerSource = fopen(D_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource== NULL) - { - printf("file[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget== NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", FilePointerTarget); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", FilePointerTarget); - getchar(); - return 0; - } - -/******************************************* -* 解密文件 -* -* D_SourceFileName 要解密的文件名 -* D_KEY 密钥 -* D_TargetFileNewName 解密后要保存的文件名 -* -* @return 解密成功或失败的数字表示 -* -* 0 = 解密失败 -* 1 = 解密成功 -********************************************/ - -/*解密算法开始*/ - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_By_Twlilght_Yujiang.cpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_By_Twlilght_Yujiang.cpp deleted file mode 100644 index ff26bbb..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_By_Twlilght_Yujiang.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Beta 1.0 -源代码修改时间: 2017-8-1 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Beta 1.0 -Source code modified by: 2017-8-1 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include //标准输入输出函数 -#include //标准库函数 -#include //字符串处理函数 -#include - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName); -int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName); - -int main() -{ - string Load_User_Keyboard_Input; - - std :: cout << "----------" << endl; - std :: cout << "Enter 1 EncryptFile" << endl; - std :: cout << "Enter 2 DecryptFile" << endl; - std :: cout << "Enter 3 Exit Program" << endl; - std :: cout << "----------" << endl; - std :: cout << "" << endl; - std :: cout << "System:Input And Output/Enter>"; - - std :: cin >> Load_User_Keyboard_Input; - getchar(); - - if(Load_User_Keyboard_Input == "1") - { - char E_SourceFileName[4096], // 加密的文件名 - E_TargetFileNewName[4096]; // 加密后要保存的文件名 - - char E_KEY[128], //File (Encryption or Encrypted) key 文件加密密钥 - E_KEY2[128], - E_KEY3[128]; - - printf("Please input >>> the source file name\n(Contains the directory name):\n"); - printf("输入要加密的文件名,[C:\]不要输入空格(含路径):\n"); - scanf("%s", E_SourceFileName); - - printf("\n"); - printf("输入(长度小于128)密钥,不要输入空格:\n"); //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - printf("Please input >>> the key,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", E_KEY); - - printf("\n"); - printf("输入(长度小于128)密钥2,不要输入空格:\n"); //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - printf("Please input >>> the key2,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", E_KEY2); - - printf("\n"); - printf("输入(长度小于128)密钥3,不要输入空格:\n"); //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - printf("Please input >>> the key3,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", E_KEY3); - - printf("\n"); - printf("Please input >>> the target file new name(Contains the directory name):\n"); - printf("加密后的文件名,不要输入空格(含路径):\n"); //给加密后的文件命名,并保存 - scanf("%s",E_TargetFileNewName); - - printf("Please wait, read and write in the file......\n"); - printf("请等待,文件读写中......\n"); - getchar(); - - if(RunEncryptFile(E_SourceFileName, E_KEY, E_KEY2, E_KEY3, E_TargetFileNewName)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SourceFileName, E_TargetFileNewName); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SourceFileName, E_TargetFileNewName); - getchar(); - system("pause"); - return 0; - } - } - if(Load_User_Keyboard_Input == "2") - { - char D_SourceFileName[4096]; //源文件名 - char D_TargetFileNewName[4096]; //目标文件新名称 - - char D_KEY[128], //File (Decryption or Decrypted) key 文件解密密钥 - D_KEY2[128], - D_KEY3[128]; - - printf("\n"); - printf("Please input >>> the source file name\n(Contains the directory name):\n"); - printf("输入要解密的文件名,[C:\]不要输入空格(含路径):\n"); - scanf("%s", D_SourceFileName); - - printf("\n"); - printf("输入(长度小于128)密钥,不要输入空格:\n"); //密钥是用户自己定义的,可以随意给需要解密的文件输入密钥 - printf("Please input >>> the key3,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", D_KEY); - - printf("\n"); - printf("输入(长度小于128)密钥2,不要输入空格:\n"); - printf("Please input >>> the key2,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", D_KEY2); - - printf("\n"); - printf("输入(长度小于128)密钥3,不要输入空格:\n"); - printf("Please input >>> the key,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", D_KEY3); - - printf("\n"); - printf("Please input >>> the target file new name(Contains the directory name):\n"); - printf("解密后的文件名,不要输入空格(含路径):\n"); //给解密后的文件命名,并保存 - scanf("%s",D_TargetFileNewName); - - printf("Please wait, read and write in the file......\n"); - printf("请等待,文件读写中......\n"); - getchar(); - - if(RunDecryptFile(D_SourceFileName, D_KEY, D_KEY2, D_KEY3, D_TargetFileNewName)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SourceFileName, D_TargetFileNewName); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SourceFileName, D_TargetFileNewName); - getchar(); - system("pause"); - return 0; - } - } - - if(Load_User_Keyboard_Input == "3") - { - return 0; - } - else - { - std :: cout << "User Input Error !" << endl; - getchar(); - exit(1); - } -} - -#include "Main_By_Twlilght_Yujiang.hpp" \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_By_Twlilght_Yujiang.hpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_By_Twlilght_Yujiang.hpp deleted file mode 100644 index 3e621d1..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_By_Twlilght_Yujiang.hpp +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************* -* 加密文件 -* -* E_SourceFileName 要加密的文件名 -* E_KEY 密钥 -* E_TargetFileNewName 加密后要保存的文件名 -* -* @return 加密成功或失败的数字表示 -* -* 0 = 加密失败 -* 1 = 加密成功 -********************************************/ - - int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //循环次数 - KeyLength = strlen(E_KEY), //密钥的长度 - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3); - - FilePointerSource = fopen(E_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource== NULL) - { - printf("file[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget== NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", FilePointerTarget); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", FilePointerTarget); - getchar(); - return 0; - } -/*加密算法开始*/ - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } - - int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //循环次数 - KeyLength = strlen(D_KEY), //密钥的长度 - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3); - - FilePointerSource = fopen(D_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource== NULL) - { - printf("file[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget== NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", FilePointerTarget); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", FilePointerTarget); - getchar(); - return 0; - } - -/******************************************* -* 解密文件 -* -* D_SourceFileName 要解密的文件名 -* D_KEY 密钥 -* D_TargetFileNewName 解密后要保存的文件名 -* -* @return 解密成功或失败的数字表示 -* -* 0 = 解密失败 -* 1 = 解密成功 -********************************************/ - -/*解密算法开始*/ - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0 ) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_EODF_By_Twlilght_Yujiang.cpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_EODF_By_Twlilght_Yujiang.cpp deleted file mode 100644 index d3b5c15..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/Main_EODF_By_Twlilght_Yujiang.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Beta 1.0 -源代码修改时间: 2017-8-1 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Beta 1.0 -Source code modified by: 2017-8-1 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include //标准输入输出函数 -#include //标准库函数 -#include //字符串处理函数 -#include - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName); -int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName); - -int main() -{ - string Load_User_Keyboard_Input; - - std :: cout << "----------" << endl; - std :: cout << "Enter 1 EncryptFile" << endl; - std :: cout << "Enter 2 DecryptFile" << endl; - std :: cout << "Enter 3 Exit Program" << endl; - std :: cout << "----------" << endl; - std :: cout << "" << endl; - std :: cout << "System:Input And Output/Enter>"; - - std :: cin >> Load_User_Keyboard_Input; - getchar(); - - if(Load_User_Keyboard_Input == "1") - { - char E_SourceFileName[4096], // 加密的文件名 - E_TargetFileNewName[4096]; // 加密后要保存的文件名 - - char E_KEY[128], //File (Encryption or Encrypted) key 文件加密密钥 - E_KEY2[128], - E_KEY3[128]; - - printf("Please input >>> the source file name\n(Contains the directory name):\n"); - printf("输入要加密的文件名,[C:\]不要输入空格(含路径):\n"); - scanf("%s", E_SourceFileName); - - printf("\n"); - printf("输入(长度小于128)密钥,不要输入空格:\n"); //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - printf("Please input >>> the key,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", E_KEY); - - printf("\n"); - printf("输入(长度小于128)密钥2,不要输入空格:\n"); //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - printf("Please input >>> the key2,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", E_KEY2); - - printf("\n"); - printf("输入(长度小于128)密钥3,不要输入空格:\n"); //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - printf("Please input >>> the key3,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", E_KEY3); - - printf("\n"); - printf("Please input >>> the target file new name(Contains the directory name):\n"); - printf("加密后的文件名,不要输入空格(含路径):\n"); //给加密后的文件命名,并保存 - scanf("%s",E_TargetFileNewName); - - printf("Please wait, read and write in the file......\n"); - printf("请等待,文件读写中......\n"); - getchar(); - - if(RunEncryptFile(E_SourceFileName, E_KEY, E_KEY2, E_KEY3, E_TargetFileNewName)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SourceFileName, E_TargetFileNewName); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SourceFileName, E_TargetFileNewName); - getchar(); - system("pause"); - return 0; - } - } - if(Load_User_Keyboard_Input == "2") - { - char D_SourceFileName[4096]; //源文件名 - char D_TargetFileNewName[4096]; //目标文件新名称 - - char D_KEY[128], //File (Decryption or Decrypted) key 文件解密密钥 - D_KEY2[128], - D_KEY3[128]; - - printf("\n"); - printf("Please input >>> the source file name\n(Contains the directory name):\n"); - printf("输入要解密的文件名,[C:\]不要输入空格(含路径):\n"); - scanf("%s", D_SourceFileName); - - printf("\n"); - printf("输入(长度小于128)密钥,不要输入空格:\n"); //密钥是用户自己定义的,可以随意给需要解密的文件输入密钥 - printf("Please input >>> the key3,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", D_KEY); - - printf("\n"); - printf("输入(长度小于128)密钥2,不要输入空格:\n"); - printf("Please input >>> the key2,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", D_KEY2); - - printf("\n"); - printf("输入(长度小于128)密钥3,不要输入空格:\n"); - printf("Please input >>> the key,Do not enter spaces!\n(length less than 128):\n"); - scanf("%s", D_KEY3); - - printf("\n"); - printf("Please input >>> the target file new name(Contains the directory name):\n"); - printf("解密后的文件名,不要输入空格(含路径):\n"); //给解密后的文件命名,并保存 - scanf("%s",D_TargetFileNewName); - - printf("Please wait, read and write in the file......\n"); - printf("请等待,文件读写中......\n"); - getchar(); - - if(RunDecryptFile(D_SourceFileName, D_KEY, D_KEY2, D_KEY3, D_TargetFileNewName)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SourceFileName, D_TargetFileNewName); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SourceFileName, D_TargetFileNewName); - getchar(); - system("pause"); - return 0; - } - } - - if(Load_User_Keyboard_Input == "3") - { - return 0; - } - else - { - std :: cout << "User Input Error !" << endl; - getchar(); - exit(1); - } -} - -#include "EODF_By_Twlilght_Yujiang.hpp" \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/StdAfx.h b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/StdAfx.h deleted file mode 100644 index e87646a..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version/StdAfx.h +++ /dev/null @@ -1,32 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_) -#define AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define DLLEXPORT __declspec(dllexport) -#define DLLIMPORT __declspec(dllimport) - -#include "stdio.h" -#include -#include -#include - -#pragma comment(lib,"ws2_32.lib") - -// TODO: reference additional headers your program requires here -void Msg(char *szFormat, ...); -void dbMsg(char *szFormat, ...); -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_) diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/EODF2_By_Twlilght_Yujiang.hpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/EODF2_By_Twlilght_Yujiang.hpp deleted file mode 100644 index 81bea11..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/EODF2_By_Twlilght_Yujiang.hpp +++ /dev/null @@ -1,621 +0,0 @@ -/******************************************* - * 加密文件 - * - * E_SourceFileName 要加密的文件名 - * E_KEY 密钥 - * E_TargetFileNewName 加密后要保存的文件名 - * - * @return 加密成功或失败的数字表示 - * - * 0 = 加密失败 - * 1 = 加密成功 - ********************************************/ - - int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(E_KEY), //密钥的长度 - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3); - - FilePointerSource = fopen(E_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", E_TargetFileNewName); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", E_TargetFileNewName); - getchar(); - return 0; - } - -/*加密算法开始*/ -//依次运行三个大型加密模块 -//Run three large encryption modules in turn - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(E_SourceFileName); - - return 1; - } - - int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(D_KEY), //密钥的长度 - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3); - - FilePointerSource = fopen(D_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", D_TargetFileNewName); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", D_TargetFileNewName); - getchar(); - return 0; - } - -/******************************************* -* 解密文件 -* -* D_SourceFileName 要解密的文件名 -* D_KEY 密钥 -* D_TargetFileNewName 解密后要保存的文件名 -* -* @return 解密成功或失败的数字表示 -* -* 0 = 解密失败 -* 1 = 解密成功 - ********************************************/ - -/*解密算法开始*/ -//依次运行大型三个解密模块 -//Run three large decryption modules in turn - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_2_By_Twlilght_Yujiang.cpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_2_By_Twlilght_Yujiang.cpp deleted file mode 100644 index 057a65f..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_2_By_Twlilght_Yujiang.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Beta 2.0 -源代码修改时间: 2017-8-11 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C ++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Beta 2.0 -Source code modified by: 2017-8-11 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include -#include //C标准输入输出函数 -#include //C标准库函数 -#include //字符串处理函数 -#include - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName); -int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName); - -void ConsoleTableColorSet(int R,int G,int B) -{ - if(R<0) R=0; - if(R>1) R=1; - - if(G<0) G=0; - if(G>1) G=1; - - if(B<0) B=0; - if(B>1) B=1; - - if(R == 1 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); - } - else if(R == 1 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN); - } - else if(R == 1 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE); - } - else if(R == 0 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE); - } - else if(R == 1 && G == 0 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED); - } - else if(R == 0 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN); - } - else if(R == 0 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE); - } - else - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY); - } -} - -int main() -{ -ProgramMainMenu: - - string Load_User_Keyboard_Input; - - system("color 0A"); - - std :: cout << "----------" << endl; - std :: cout << "Enter 1 EncryptFile" << endl; - std :: cout << "Enter 2 DecryptFile" << endl; - std :: cout << "Enter 3 Exit Program" << endl; - std :: cout << "----------" << endl; - std :: cout << "" << endl; - std :: cout << "System:Input And Output/Enter>"; - - std :: cin >> Load_User_Keyboard_Input; - getchar(); - - if(Load_User_Keyboard_Input == "1") - { - system("cls"); - system("color 1A"); - - char E_SourceFileName[4096], // 加密的文件名 - E_TargetFileNewName[4096]; // 加密后要保存的文件名 - - //char E_TargetFileLastNameOutput = (E_TargetFileNewName + ".TY_ENCRYPTED"); //最后保存的加密后文件名 - - char E_KEY[128], //File (Encryption or Encrypted) key 文件加密密钥 - E_KEY2[128], - E_KEY3[128]; - - std :: cout << "Please input >>> the source file name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "输入要加密的文件名,[C:\]不要输入空格(含路径):" << endl; - std :: cin >> E_SourceFileName; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥,不要输入空格:" << endl; //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - std :: cout << "Please input >>> the key,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥2,不要输入空格:" << endl; - std :: cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY2; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥3,不要输入空格:" << endl; - std :: cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY3; - - std :: cout << "\n"; - std :: cout << "Please output >>> the target file new name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "加密后的文件名,不要输入空格(含路径):" << endl; //给加密后的文件命名,并保存 - std :: cin >> E_TargetFileNewName; - system("cls"); - - std :: cout << "正在记录并导出,本次用于文件加密,3个密钥字符串......" << endl; - std :: cout << "Is being recorded and exported, this time for file encryption, 3 key string......" << endl; - ofstream PasswordOutputKeyFile; - PasswordOutputKeyFile.open("FILE-ENCRYPTION-DECRYPTIPN-PASSWORD.KEY.TXT"); - PasswordOutputKeyFile << "Twlilght_Yujiang File Lock Password [Key String] Save\n" << endl; - PasswordOutputKeyFile << "\n" << endl; - PasswordOutputKeyFile << "Source Input File Name and Path: " << E_SourceFileName << "\n" << endl; - PasswordOutputKeyFile << "EncryptFile: New Output Target File Name and Path: " << E_TargetFileNewName << "\n" << endl; - PasswordOutputKeyFile << "Key string1 [Password1]: " << E_KEY << "\n" << endl; - PasswordOutputKeyFile << "Key string2 [Password2]: " << E_KEY2 << "\n" << endl; - PasswordOutputKeyFile << "Key string3 [Password3]: " << E_KEY3 << "\n" << endl; - PasswordOutputKeyFile << "<******************************************************************************************>" << "\n" << endl; - PasswordOutputKeyFile.close(); - - std :: cout << "Please wait, read and write in the file......" << endl; - std :: cout << "请等待,文件读写中......" << endl; - getchar(); - - if(RunEncryptFile(E_SourceFileName, E_KEY, E_KEY2, E_KEY3, E_TargetFileNewName)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SourceFileName, E_TargetFileNewName); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SourceFileName, E_TargetFileNewName); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - if(Load_User_Keyboard_Input == "2") - { - system("cls"); - system("color 1A"); - - char D_SourceFileName[4096], //源文件名 - D_TargetFileNewName[4096]; //目标文件新名称 - - //char D_TargetFileLastNameOutput = (D_TargetFileNewName - ".TY_ENCRYPTED"); //最后保存的解密后文件名 - - char D_KEY[128], //File (Decryption or Decrypted) key 文件解密密钥 - D_KEY2[128], - D_KEY3[128]; - - std :: cout << "Please input >>> the source file name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "输入要解密的文件名,[C:\]不要输入空格(含路径):" << endl; - std :: cin >> D_SourceFileName; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥,不要输入空格:" << endl; //密钥是用户自己定义的,可以随意给需要解密的文件输入密钥 - std :: cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥2,不要输入空格:" << endl; - std :: cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY2; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥3,不要输入空格:" << endl; - std :: cout << "Please input >>> the key,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY3; - - std :: cout << "\n"; - std :: cout << "Please output >>> the target file new name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "解密后的文件名,不要输入空格(含路径):" << endl; //给解密后的文件命名,并保存 - std :: cin >> D_TargetFileNewName; - system("cls"); - - std :: cout << "Please wait, read and write in the file......" << endl; - std :: cout << "请等待,文件读写中......" << endl; - getchar(); - - if(RunDecryptFile(D_SourceFileName, D_KEY, D_KEY2, D_KEY3, D_TargetFileNewName)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SourceFileName, D_TargetFileNewName); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SourceFileName, D_TargetFileNewName); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - - if(Load_User_Keyboard_Input == "3") - { - return 0; - } - else - { - std :: cout << "User Input Error !" << endl; - getchar(); - exit(1); - } -} - -#include "Main_2_By_Twlilght_Yujiang.hpp" \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_2_By_Twlilght_Yujiang.hpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_2_By_Twlilght_Yujiang.hpp deleted file mode 100644 index 81bea11..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_2_By_Twlilght_Yujiang.hpp +++ /dev/null @@ -1,621 +0,0 @@ -/******************************************* - * 加密文件 - * - * E_SourceFileName 要加密的文件名 - * E_KEY 密钥 - * E_TargetFileNewName 加密后要保存的文件名 - * - * @return 加密成功或失败的数字表示 - * - * 0 = 加密失败 - * 1 = 加密成功 - ********************************************/ - - int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(E_KEY), //密钥的长度 - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3); - - FilePointerSource = fopen(E_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", E_TargetFileNewName); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", E_TargetFileNewName); - getchar(); - return 0; - } - -/*加密算法开始*/ -//依次运行三个大型加密模块 -//Run three large encryption modules in turn - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY2进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY3进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(E_SourceFileName); - - return 1; - } - - int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName) - { - FILE *FilePointerSource, *FilePointerTarget; //要打开的文件的指针 - char buffer[1024]; //缓冲区,用于存放从文件读取的数据 - - int FileByteData, //每次从文件中读取的字节数 - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(D_KEY), //密钥的长度 - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3); - - FilePointerSource = fopen(D_SourceFileName, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SourceFileName); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SourceFileName); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TargetFileNewName, "wb"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", D_TargetFileNewName); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", D_TargetFileNewName); - getchar(); - return 0; - } - -/******************************************* -* 解密文件 -* -* D_SourceFileName 要解密的文件名 -* D_KEY 密钥 -* D_TargetFileNewName 解密后要保存的文件名 -* -* @return 解密成功或失败的数字表示 -* -* 0 = 解密失败 -* 1 = 解密成功 - ********************************************/ - -/*解密算法开始*/ -//依次运行大型三个解密模块 -//Run three large decryption modules in turn - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/***********************************************************************************************************************************************************/ - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY2进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 1, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和D_KEY3进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 1, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - return 1; - } \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.cpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.cpp deleted file mode 100644 index 6e4b34e..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/Main_EODF2_By_Twlilght_Yujiang.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Beta 2.0 -源代码修改时间: 2017-8-11 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C ++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Beta 2.0 -Source code modified by: 2017-8-11 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include -#include //C标准输入输出函数 -#include //C标准库函数 -#include //字符串处理函数 -#include - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(char *E_SourceFileName, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_TargetFileNewName); -int RunDecryptFile(char *D_SourceFileName, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_TargetFileNewName); - -void ConsoleTableColorSet(int R,int G,int B) -{ - if(R<0) R=0; - if(R>1) R=1; - - if(G<0) G=0; - if(G>1) G=1; - - if(B<0) B=0; - if(B>1) B=1; - - if(R == 1 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); - } - else if(R == 1 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN); - } - else if(R == 1 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE); - } - else if(R == 0 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE); - } - else if(R == 1 && G == 0 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED); - } - else if(R == 0 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN); - } - else if(R == 0 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE); - } - else - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY); - } -} - -int main() -{ -ProgramMainMenu: - - string Load_User_Keyboard_Input; - - system("color 0A"); - - std :: cout << "----------" << endl; - std :: cout << "Enter 1 EncryptFile" << endl; - std :: cout << "Enter 2 DecryptFile" << endl; - std :: cout << "Enter 3 Exit Program" << endl; - std :: cout << "----------" << endl; - std :: cout << "" << endl; - std :: cout << "System:Input And Output/Enter>"; - - std :: cin >> Load_User_Keyboard_Input; - getchar(); - - if(Load_User_Keyboard_Input == "1") - { - system("cls"); - system("color 1A"); - - char E_SourceFileName[4096], // 加密的文件名 - E_TargetFileNewName[4096]; // 加密后要保存的文件名 - - //char E_TargetFileLastNameOutput = (E_TargetFileNewName + ".TY_ENCRYPTED"); //最后保存的加密后文件名 - - char E_KEY[128], //File (Encryption or Encrypted) key 文件加密密钥 - E_KEY2[128], - E_KEY3[128]; - - std :: cout << "Please input >>> the source file name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "输入要加密的文件名,[C:\]不要输入空格(含路径):" << endl; - std :: cin >> E_SourceFileName; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥,不要输入空格:" << endl; //密钥是用户自己定义的,(长度小于128)。可以随意给需要加密的文件添加密钥 - std :: cout << "Please input >>> the key,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥2,不要输入空格:" << endl; - std :: cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY2; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥3,不要输入空格:" << endl; - std :: cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> E_KEY3; - - std :: cout << "\n"; - std :: cout << "Please output >>> the target file new name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "加密后的文件名,不要输入空格(含路径):" << endl; //给加密后的文件命名,并保存 - std :: cin >> E_TargetFileNewName; - system("cls"); - - std :: cout << "正在记录并导出,本次用于文件加密,3个密钥字符串......" << endl; - std :: cout << "Is being recorded and exported, this time for file encryption, 3 key string......" << endl; - ofstream PasswordOutputKeyFile; - PasswordOutputKeyFile.open("FILE-ENCRYPTION-DECRYPTIPN-PASSWORD.KEY.TXT"); - PasswordOutputKeyFile << "Twlilght_Yujiang File Lock Password [Key String] Save\n" << endl; - PasswordOutputKeyFile << "\n" << endl; - PasswordOutputKeyFile << "Source Input File Name and Path: " << E_SourceFileName << "\n" << endl; - PasswordOutputKeyFile << "EncryptFile: New Output Target File Name and Path: " << E_TargetFileNewName << "\n" << endl; - PasswordOutputKeyFile << "Key string1 [Password1]: " << E_KEY << "\n" << endl; - PasswordOutputKeyFile << "Key string2 [Password2]: " << E_KEY2 << "\n" << endl; - PasswordOutputKeyFile << "Key string3 [Password3]: " << E_KEY3 << "\n" << endl; - PasswordOutputKeyFile << "<******************************************************************************************>" << "\n" << endl; - PasswordOutputKeyFile.close(); - - std :: cout << "Please wait, read and write in the file......" << endl; - std :: cout << "请等待,文件读写中......" << endl; - getchar(); - - if(RunEncryptFile(E_SourceFileName, E_KEY, E_KEY2, E_KEY3, E_TargetFileNewName)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SourceFileName, E_TargetFileNewName); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SourceFileName, E_TargetFileNewName); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - if(Load_User_Keyboard_Input == "2") - { - system("cls"); - system("color 1A"); - - char D_SourceFileName[4096], //源文件名 - D_TargetFileNewName[4096]; //目标文件新名称 - - //char D_TargetFileLastNameOutput = (D_TargetFileNewName - ".TY_ENCRYPTED"); //最后保存的解密后文件名 - - char D_KEY[128], //File (Decryption or Decrypted) key 文件解密密钥 - D_KEY2[128], - D_KEY3[128]; - - std :: cout << "Please input >>> the source file name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "输入要解密的文件名,[C:\]不要输入空格(含路径):" << endl; - std :: cin >> D_SourceFileName; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥,不要输入空格:" << endl; //密钥是用户自己定义的,可以随意给需要解密的文件输入密钥 - std :: cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥2,不要输入空格:" << endl; - std :: cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY2; - - std :: cout << "\n"; - std :: cout << "输入(长度小于128)密钥3,不要输入空格:" << endl; - std :: cout << "Please input >>> the key,Do not enter spaces!\n(length less than 128):" << endl; - std :: cin >> D_KEY3; - - std :: cout << "\n"; - std :: cout << "Please output >>> the target file new name.\nDo not enter spaces!\n(Contains the directory name):" << endl; - std :: cout << "解密后的文件名,不要输入空格(含路径):" << endl; //给解密后的文件命名,并保存 - std :: cin >> D_TargetFileNewName; - system("cls"); - - std :: cout << "Please wait, read and write in the file......" << endl; - std :: cout << "请等待,文件读写中......" << endl; - getchar(); - - if(RunDecryptFile(D_SourceFileName, D_KEY, D_KEY2, D_KEY3, D_TargetFileNewName)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SourceFileName, D_TargetFileNewName); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SourceFileName, D_TargetFileNewName); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - - if(Load_User_Keyboard_Input == "3") - { - return 0; - } - else - { - std :: cout << "User Input Error !" << endl; - getchar(); - exit(1); - } -} - -#include "EODF2_By_Twlilght_Yujiang.hpp" \ No newline at end of file diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/StdAfx.h b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/StdAfx.h deleted file mode 100644 index e87646a..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version2/StdAfx.h +++ /dev/null @@ -1,32 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_) -#define AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define DLLEXPORT __declspec(dllexport) -#define DLLIMPORT __declspec(dllimport) - -#include "stdio.h" -#include -#include -#include - -#pragma comment(lib,"ws2_32.lib") - -// TODO: reference additional headers your program requires here -void Msg(char *szFormat, ...); -void dbMsg(char *szFormat, ...); -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_) diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/EODF3_By_Twlilght_Yujiang.hpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/EODF3_By_Twlilght_Yujiang.hpp deleted file mode 100644 index 8a17106..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/EODF3_By_Twlilght_Yujiang.hpp +++ /dev/null @@ -1,487 +0,0 @@ -/******************************************* -* 加密文件 -* -* E_SourceFileName 需要加密的文件名 -* E_KEY 密钥 -* E_TargetFileNewName 加密完成后要保存的文件名 -* -* @return 加密成功或失败的数字表示 -* -* 0 = 加密失败 -* 1 = 加密成功 -********************************************/ - - int RunEncryptFile(const char *E_SourceFileCharPath, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_KEY4, const char *E_TargetFileCharPath) - { - FILE *FilePointerSource, *FilePointerTarget; //需要打开的文件的指针 Need to open the file pointer - char buffer[1024]; //文件流缓冲区,用于存放从文件读取的数据 File stream buffer, used to store the data read from the file - - int FileByteData, //每次从文件中读取的字节数 The number of bytes read from the file each time - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(E_KEY), //密钥的长度 The length of the key - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3), - KeyLength4 = strlen(E_KEY4); - - FilePointerSource = fopen(E_SourceFileCharPath, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SourceFileCharPath); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SourceFileCharPath); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TargetFileCharPath, "wb+"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", E_TargetFileCharPath); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", E_TargetFileCharPath); - getchar(); - return 0; - } - -/*加密算法开始*/ - -/*****************************************************************************buffer[RTNOC]******************************************************************************/ - -//运行大型加密模块 -//Run large encryption module - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - int NOIEM; //初始加密模块次数 (Number of initial encryption modules) - int MAX_NOT_E_MODULE = 66; //运行加密模块循环次数 (The maximum number of times the encryption module is running) - - for(NOIEM = 0;NOIEM < MAX_NOT_E_MODULE;NOIEM++) - { - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - - - - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥4在缓冲区中计算 -//The file and key4 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - }; - -/***********************************************************************************************************************************************************/ - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(E_SourceFileCharPath); - - return 1; - } - - int RunDecryptFile(const char *D_SourceFileCharPath, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_KEY4, const char *D_TargetFileCharPath) - { - FILE *FilePointerSource, *FilePointerTarget; //需要打开的文件的指针 Need to open the file pointer - char buffer[1024]; //文件流缓冲区,用于存放从文件读取的数据 File stream buffer, used to store the data read from the file - - int FileByteData, //每次从文件中读取的字节数 The number of bytes read from the file each time - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(D_KEY), //密钥的长度 The length of the key - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3), - KeyLength4 = strlen(D_KEY4); - - FilePointerSource = fopen(D_SourceFileCharPath, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SourceFileCharPath); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SourceFileCharPath); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TargetFileCharPath, "wb+"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", D_TargetFileCharPath); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", D_TargetFileCharPath); - getchar(); - return 0; - } - -/******************************************* -* 解密文件 -* -* D_SourceFileName 需要解密的文件名 -* D_KEY 密钥 -* D_TargetFileNewName 解密完成后要保存的文件名 -* -* @return 解密成功或失败的数字表示 -* -* 0 = 解密失败 -* 1 = 解密成功 -********************************************/ - -/*解密算法开始*/ - -/***********************************************************************************************************************************************************/ - -//运行大型解密模块 -//Run large decryption module - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - int NOIDM; //初始解密模块次数 (Number of initial decryption modules) - int MAX_NOT_D_MODULE = 66; //运行解密模块循环次数 (The maximum number of times the decryption module is running) - - for(NOIDM = 0;NOIDM < MAX_NOT_D_MODULE;NOIDM++) - { - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥4在缓冲区中计算 -//The file and key4 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - }; - -/***********************************************************************************************************************************************************/ - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(D_SourceFileCharPath); - - return 1; - } diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_3_By_Twlilght_Yujiang.cpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_3_By_Twlilght_Yujiang.cpp deleted file mode 100644 index af369a8..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_3_By_Twlilght_Yujiang.cpp +++ /dev/null @@ -1,764 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Beta 3.0 -源代码修改时间: 2017-8-14 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C ++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Beta 3.0 -Source code modified by: 2017-8-14 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include -#include -#include //计算机C语言标准输入输出函数 Computer C language standard input and output functions -#include //计算机C语言标准库函数 Computer C language standard library functions -#include //计算机C语言字符串处理函数 Computer C language string handling functions -#include -#include "stdafx.h" - -//#include //MakeSureDirectoryPathExists(""); -//#pragma comment(lib, "ImageHlp.lib") - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(const char *E_SourceFileCharPath, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_KEY4, const char *E_TargetFileCharPath); -int RunDecryptFile(const char *D_SourceFileCharPath, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_KEY4, const char *D_TargetFileCharPath); - -//以下变量,应用到文件被加密时 -//The following variables apply when the file is encrypted -//***声明代码-开始 Declare the code - the beginning*** -string E_IF_PATH = ".\\WorkPath\\Encrypt\\InputFile\\", //加密之前,文件的路径 Before encrypting the path of the file -E_OF_PATH = ".\\WorkPath\\Encrypt\\OutputFile\\"; //加密之后,文件的路径 After encrypting the path of the file - -string E_SourceFileName, // 源文件名 -E_SourceFileMainName, // 源文件主要名 -E_SourceFileExtendedName, // 源文件扩展名 -E_TargetFileExtendedName; // 目标文件扩展名 - -char E_KEY[256], //File (Encryption or Encrypted) key 文件加密密钥 -E_KEY2[256], -E_KEY3[256], -E_KEY4[256]; -//***声明代码-结束 Declare the code - end*** - -//以下变量,应用到文件被解密时 -//The following variables apply when the file is decrypted -//***声明代码-开始 Declare the code - the beginning*** -string D_IF_PATH = ".\\WorkPath\\Decrypt\\InputFile\\", //解密之前,文件的路径 Before decrypting the path of the file -D_OF_PATH = ".\\WorkPath\\Decrypt\\OutputFile\\"; //解密之后,文件的路径 After decrypting the path of the file - -string D_SourceFileName, //源文件名 -D_TargetFileMainName, //目标文件主要名 -D_TargetFileTempName, //目标文件临时添加名 -D_TargetFileExtendedName; //目标文件源扩展名 - -char D_KEY[256], //File (Decryption or Decrypted) key 文件解密密钥 -D_KEY2[256], -D_KEY3[256], -D_KEY4[256]; -//***声明代码-结束 Declare the code - end*** - -/****************************************************************************************************************************************************************/ - -void ConsoleTableColorSet(int R, int G, int B) -{ - if (R < 0) R = 0; - if (R > 1) R = 1; - - if (G < 0) G = 0; - if (G > 1) G = 1; - - if (B < 0) B = 0; - if (B > 1) B = 1; - - if (R == 1 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); - } - else if (R == 1 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN); - } - else if (R == 1 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE); - } - else if (R == 0 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE); - } - else if (R == 1 && G == 0 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); - } - else if (R == 0 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN); - } - else if (R == 0 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE); - } - else - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY); - } -} - -int main() -{ - ProgramMainMenu: - - string Load_User_Keyboard_Input; - - system("color 0A"); - system("cls"); - - std::cout << "----------------------------------------" << endl; - std::cout << "Enter 1 Encrypt File" << endl; - std::cout << "1.加密文件\n" << endl; - std::cout << "Enter 2 Decrypt File" << endl; - std::cout << "2.解密文件\n" << endl; - std::cout << "Enter 3 Use The Information Manual" << endl; - std::cout << "3.使用信息说明手册\n" << endl; - std::cout << "Enter 4 Clean Up The Workspace[To Restore The Initial State]" << endl; - std::cout << "4.清理工作空间[恢复初始状态]\n" << endl; - std::cout << "Enter 5 Exit Program" << endl; - std::cout << "5.退出程序\n" << endl; - std::cout << "----------------------------------------" << endl; - std::cout << "System:Input And Output/Enter>"; - - std::cin >> Load_User_Keyboard_Input; - getchar(); - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "1") - { - if (!access(".\\WorkPath\\Encrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 20%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Encrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 40%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\OutputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 60%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 80%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\OutputFile\\"); - } - - if (!access(".\\File-Key-Record-Log\\", 0)) - { - std::cout << "Building and Loading Folder 100%" << endl; - } - else - { - system("@Mkdir .\\File-Key-Record-Log\\"); - } - - system("cls"); - system("color 1A"); - - ConsoleTableColorSet(0, 0, 0); - std::cout << "Please input >>> the source file name + file extension name.\nDo not enter spaces!\n:" << endl; - std::cout << "输入要加密的文件名+文件扩展名,不要输入空格!" << endl; - std::cin >> E_SourceFileName; - - std::cout << "Please input >>> the source file name, not the file extension name!\nDo not enter spaces!\n:" << endl; - std::cout << "输入要加密的文件主要名,不是文件扩展名!不要输入空格!" << endl; - std::cin >> E_SourceFileMainName; - - std::cout << "Please input >>> the file extension name.\nDo not enter spaces!\n:" << endl; - std::cout << "输入要加密的文件扩展名,不要输入空格!" << endl; - std::cin >> E_SourceFileExtendedName; - system("cls"); - - std::cout << "正在记录并导出,源文件名称......\n[警告!]在进行本次操作后,请下次选择同样名称的加密文件,进行解密文件操作!\n否则,在那之前,请立即禁止使用加密文件功能!" << endl; - std::cout << "Recording and exporting, source file name......\n[Warning!]After doing this operation, please select the same name next time the encrypted file, decrypt the file operation!\nOtherwise, before that, please immediately disable the use of encrypted file function" << endl; - std::cout << "您是否接受这个协议?[键盘Enter继续] 或者 [关闭程序]......" << endl; - std::cout << "Whether you accept this agreement?[Keyboard Enter Continue] Or [Close this program]......" << endl; - - system("pause"); - system("cls"); - - ofstream SourceFileNameTempOutput; - SourceFileNameTempOutput.open(".\\SourceFileName_Temp.INI"); - SourceFileNameTempOutput << E_SourceFileName << endl; - SourceFileNameTempOutput.close(); - SourceFileNameTempOutput.open(".\\SourceFileMainName_Temp.INI"); - SourceFileNameTempOutput << E_SourceFileMainName << endl; - SourceFileNameTempOutput.close(); - SourceFileNameTempOutput.open(".\\SourceFileExtendedName_Temp.INI"); - SourceFileNameTempOutput << E_SourceFileExtendedName << endl; - SourceFileNameTempOutput.close(); - - //加密密钥码是用户自己定义的,(长度小于256)。可以任意的给一个需要加密的文件添加一个或多个加密密钥码 - //Encryption key code is user-defined, (length less than 256). You can optionally add one or more encryption keys to the one files you want to encrypt - E_KEY_LENTH_IS_INCORRECT: - int E_KEY_CODE_MAX_LENGTH = 256; - - ConsoleTableColorSet(0, 0, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥,不要输入空格!" << endl; - std::cout << "Please input >>> the key,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY; - if(strlen(E_KEY) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY,NULL,sizeof(E_KEY)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(0, 1, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥2,不要输入空格!" << endl; - std::cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY2; - if(strlen(E_KEY2) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY2,NULL,sizeof(E_KEY2)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥2的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key2 length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(0, 1, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥3,不要输入空格!" << endl; - std::cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY3; - if(strlen(E_KEY3) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY3,NULL,sizeof(E_KEY3)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥3的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key3 length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥4,不要输入空格!" << endl; - std::cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY4; - if(strlen(E_KEY4) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY4,NULL,sizeof(E_KEY4)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥4的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key4 length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 1); - std::cout << "\n"; - std::cout << "Please output >>> file extension name.\nDo not enter spaces!\n[.TSMY-ENCRYPTED]:" << endl; - std::cout << "输出文件扩展名,不要输入空格[.TSMY-ENCRYPTED]:" << endl; //给加密后的文件输出文件扩展名,并保存 Export the file extension to the encrypted file and save it - std::cin >> E_TargetFileExtendedName; - if (E_TargetFileExtendedName == " ") - { - string E_TargetFileAddExtendedName = ".TSMY-ENCRYPTED"; - E_TargetFileExtendedName = E_TargetFileAddExtendedName; - } - - system("cls"); - - string E_SourceFileStringPath = E_IF_PATH + E_SourceFileName; - string E_TargetFileStringPath = E_OF_PATH + E_SourceFileName + E_TargetFileExtendedName; - - const char *E_SourceFileCharPath = E_SourceFileStringPath.c_str(); - const char *E_TargetFileCharPath = E_TargetFileStringPath.c_str(); - - /*char *E_SourceFileLastNameOutput; //最后读写的文件名 - strcpy(E_SourceFileLastNameOutput,E_SourceFileCharPath); - char *E_TargetFileLastNameOutput; //最后保存的加密后文件名 - strcpy(E_TargetFileLastNameOutput,E_TargetFileCharPath);*/ - - ConsoleTableColorSet(1, 1, 0); - std::cout << "正在记录并导出,本次用于文件加密,4个密钥字符串......" << endl; - std::cout << "Is being recorded and exported, this time for file encryption, 4 key string......" << endl; - ofstream PasswordOutputKeyFile; - PasswordOutputKeyFile.open(".\\File-Key-Record-Log\\ENCRYPTION-DECRYPTIPN-PASSWORD.KEY.TXT"); - PasswordOutputKeyFile << "Twlilght_Yujiang File Lock Password [Key String] Save\n" << endl; - PasswordOutputKeyFile << "\n" << endl; - PasswordOutputKeyFile << "Source Input File Name and Path: " << E_SourceFileStringPath << "\n" << endl; - PasswordOutputKeyFile << "EncryptFile: New Output Target File Name and Path: " << E_TargetFileStringPath << "\n" << endl; - PasswordOutputKeyFile << "Key string1 [Password1]: " << E_KEY << "\n" << endl; - PasswordOutputKeyFile << "Key string2 [Password2]: " << E_KEY2 << "\n" << endl; - PasswordOutputKeyFile << "Key string3 [Password3]: " << E_KEY3 << "\n" << endl; - PasswordOutputKeyFile << "Key string4 [Password4]: " << E_KEY4 << "\n" << endl; - PasswordOutputKeyFile << "<******************************************************************************************>" << "\n" << endl; - PasswordOutputKeyFile.close(); - - ConsoleTableColorSet(1, 1, 1); - std::cout << "Please wait, read and write in the file......" << endl; - std::cout << "请等待,文件读写中......" << endl; - getchar(); - - if (RunEncryptFile(E_SourceFileCharPath, E_KEY, E_KEY2, E_KEY3, E_KEY4, E_TargetFileCharPath)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SourceFileCharPath, E_TargetFileCharPath); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SourceFileCharPath, E_TargetFileCharPath); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "2") - { - if (!access(".\\WorkPath\\Encrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 20%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Encrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 40%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\OutputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 60%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 80%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\OutputFile\\"); - } - - if (!access(".\\File-Key-Record-Log\\", 0)) - { - std::cout << "Building and Loading Folder 100%" << endl; - } - else - { - system("@Mkdir .\\File-Key-Record-Log\\"); - } - - system("cls"); - system("color 1A"); - - ConsoleTableColorSet(1, 1, 1); - std::cout << "Please input >>> the source file name + file extension name.\nDo not enter spaces!\n:" << endl; - std::cout << "输入要解密的文件名+文件扩展名,不要输入空格!" << endl; - std::cin >> D_SourceFileName; - - //解密密钥码是由用户自己在加密文件步骤设置的。这个定义,来自被加密密钥码的操作过的二进制文件(说明:解密密钥码等于加密密钥码)。你可以给任意一个需要解密的文件,输入正确的解密密钥码 - //The decryption key code is set by the user himself at the encrypted file step. This definition, from the encrypted key code of the operation of the binary file (Description: decryption key code is equal to the encryption key code). You can give a random file to be decrypted and enter the correct decryption key code - D_KEY_LENTH_IS_INCORRECT: - int D_KEY_CODE_MAX_LENGTH = 256; - - ConsoleTableColorSet(1, 1, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥,不要输入空格!" << endl; - std::cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY; - if(strlen(D_KEY) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY,NULL,sizeof(D_KEY)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥2,不要输入空格!" << endl; - std::cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY2; - if(strlen(D_KEY2) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY2,NULL,sizeof(D_KEY2)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥2的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key2 length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥3,不要输入空格!" << endl; - std::cout << "Please input >>> the key,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY3; - if(strlen(D_KEY3) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY3,NULL,sizeof(D_KEY3)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥3的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key3 length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(0, 1, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥4,不要输入空格!" << endl; - std::cout << "Please input >>> the key,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY4; - if(strlen(D_KEY4) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY4,NULL,sizeof(D_KEY4)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥4的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key4 length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - system("cls"); - - ConsoleTableColorSet(0, 1, 0); - - std::cout << "\n"; - std::cout << "如果在当前文件夹下配置文件[.\\*.INI]不存在,程序就不会帮您自动恢复原来的文件名称。\n你需要重新输入文件名!" << endl; - std::cout << "If the configuration file [.\\*.INI] does not exist in the current folder, the program will not automatically restore the original file name.\nYou need to re-enter the file name!" << endl; - std::cout << "Please output >>> target file main name,not the file extension name!\nDo not enter spaces!\n[DATA-DECRYPTED]:" << endl; - std::cout << "输出文件主要名,不是文件扩展名,不要输入空格[DATA-TSMY-DECRYPTED]!" << endl; //给解密后的文件输出主要文件名,并保存 Output the main file name to the decrypted file and save it - if (!access(".\\SourceFileMainName_Temp.INI", 0)) - { - //char TFMN_Buffer[256]; - ifstream LoadSourceFileNameConfigure(".\\SourceFileMainName_Temp.INI", ios::in); - if (LoadSourceFileNameConfigure.fail()) - { - std::cout << "加载配置文件时,出现了未知错误并结束" << endl; - std::cout << "When the configuration file is loaded, an unknown error has occurred and ends" << endl; - } - while (!LoadSourceFileNameConfigure.eof()) - { - LoadSourceFileNameConfigure >> D_TargetFileMainName; - //LoadSourceFileNameConfigure.getline(TFMN_Buffer,256,'\n'); //getline(char *,int,char) 表示该行字符达到256个或遇到换行就结束 - //D_TargetFileMainName = TFMN_Buffer; - - std::cout << "您已成功跳过此步骤" << endl; - std::cout << "You have successfully skipped this step" << endl; - } - LoadSourceFileNameConfigure.close(); - } - else - { - std::cout << "配置文件" << ".\\SourceFileMainName_Temp.INI" << "未找到!\n" << "请重新输入名称!" << endl; - std::cout << "Configuration file" << ".\\SourceFileMainName_Temp.INI" << "Not found!\n" << "Please re-enter the name!" << endl; - HANDLE hFILE = CreateFile(".\\SourceFileMainName_Temp.INI", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - std::cin >> D_TargetFileMainName; - - } - - system("cls"); - - std::cout << "如果在当前文件夹下配置文件[.\\*.INI]不存在,程序就不会帮您自动恢复原来的文件名称。\n你需要重新输入文件名!" << endl; - std::cout << "If the configuration file [.\\*.INI] does not exist in the current folder, the program will not automatically restore the original file name.\nYou need to re-enter the file name!" << endl; - std::cout << "Please output >>> target file extension name!\nDo not enter spaces!\n[Example: .txt]:" << endl; - std::cout << "输出文件扩展名,不要输入空格[实例: .txt]!" << endl; //给解密后的文件输出文件扩展名,并保存 - if (!access(".\\SourceFileExtendedName_Temp.INI", 0)) - { - ifstream LoadSourceFileNameConfigure(".\\SourceFileExtendedName_Temp.INI", ios::in); - //char TFEN_Buffer[256]; - if (LoadSourceFileNameConfigure.fail()) - { - std::cout << "加载配置文件时,出现了未知错误并结束" << endl; - std::cout << "When the configuration file is loaded, an unknown error has occurred and ends" << endl; - } - while (!LoadSourceFileNameConfigure.eof()) - { - LoadSourceFileNameConfigure >> D_TargetFileExtendedName; - //LoadSourceFileNameConfigure.getline(TFEN_Buffer,256,'\n'); //getline(char *,int,char) 表示该行字符达到256个或遇到换行就结束 - //D_TargetFileExtendedName = TFEN_Buffer; - - std::cout << "您已成功跳过此步骤" << endl; - std::cout << "You have successfully skipped this step" << endl; - } - LoadSourceFileNameConfigure.close(); - } - else - { - std::cout << "配置文件" << ".\\SourceFileExtendedName_Temp.INI" << "未找到!\n" << "请重新输入名称!" << endl; - std::cout << "Configuration file" << ".\\SourceFileExtendedName_Temp.INI" << "Not found!\n" << "Please re-enter the name!" << endl; - HANDLE hFILE = CreateFile(".\\SourceFileExtendedName_Temp.INI", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - std::cin >> D_TargetFileExtendedName; - } - - system("cls"); - - std::cout << "\n"; - std::cout << "如果在当前文件夹下配置文件[.\\*.INI]不存在,程序就不会帮您自动恢复原来的文件名称。\n你需要重新输入文件名!" << endl; - std::cout << "If the configuration file [.\\*.INI] does not exist in the current folder, the program will not automatically restore the original file name.\nYou need to re-enter the file name!" << endl; - std::cout << "Please output >>> target file temp add name.\nDo not enter spaces!\n[-DECRYPTED]:" << endl; - std::cout << "输出文件临时添加名,不要输入空格[-TSMY-DECRYPTED]!" << endl; //给解密后的文件输出文件临时添加名,并保存 - std::cout << "Prevent source encrypted files from being overwritten" << endl; - std::cout << "防止源加密文件被覆盖" << endl; - std::cin >> D_TargetFileTempName; - if (D_TargetFileTempName == " ") - { - string D_TargetFileAddName = "-TSMY-DECRYPTED"; - D_TargetFileTempName = D_TargetFileAddName; - } - - system("cls"); - - string D_SourceFileStringPath = D_IF_PATH + D_SourceFileName; - string D_TargetFileStringPath = D_OF_PATH + D_TargetFileMainName + D_TargetFileTempName + D_TargetFileExtendedName; - - const char *D_SourceFileCharPath = D_SourceFileStringPath.c_str(); - const char *D_TargetFileCharPath = D_TargetFileStringPath.c_str(); - - /*char *D_SourceFileLastNameOutput; //最后读写的文件名 - strcpy(D_SourceFileLastNameOutput,D_SourceFileCharPath); - char *D_TargetFileLastNameOutput; //最后临时保存的解密后的文件名 - strcpy(D_TargetFileLastNameOutput,D_TargetFileCharPath);*/ - - ConsoleTableColorSet(0, 0, 1); - std::cout << "Please wait, read and write in the file......" << endl; - std::cout << "请等待,文件读写中......" << endl; - getchar(); - - if (RunDecryptFile(D_SourceFileCharPath, D_KEY, D_KEY2, D_KEY3, D_KEY4, D_TargetFileCharPath)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SourceFileCharPath, D_TargetFileCharPath); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SourceFileCharPath, D_TargetFileCharPath); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "3") - { - Instruction_Manual_Language_Restart: - system("cls"); - std::cout << "欢迎你的到来! 这是本程序的说明手册[Beta Version 3.0],请务必在使用前,仔细阅读" << endl; - std::cout << "Welcome to your arrival! This is the instruction manual [Beta Version 3.0] of this program, please be sure to read carefully before using it" << endl; - std::cout << "" << endl; - std::cout << "enUS----------English 英文" << endl; - std::cout << "zhCN----------Chinese 中文" << endl; - std::cout << "MENU----------Back Main Menu 返回主菜单" << endl; - string Instruction_Manual_Language; - std::cin >> Instruction_Manual_Language; - if (Instruction_Manual_Language == "enUS") - { - system("cls"); - system("color 67"); - std::cout << "When the program executes the function of encrypting the file or decrypting the file, it will create the workspace folder, input the folder, output the folder.\n" << endl; - std::cout << "When the program encrypts the file or decrypts the file and waits, the program is reading and writing the file in the background.\nNever close the program at this time! Otherwise your data is damaged and bear the consequences.\nIt is recommended that you after the data backup, use this program to encrypt the file or decrypt the file!\n" << endl; - system("pause"); - system("cls"); - } - if (Instruction_Manual_Language == "zhCN") - { - system("cls"); - system("color 17"); - std::cout << "当程序执行加密文件或解密文件的功能时,将创建工作空间文件夹,输入文件夹,输出文件夹。\n" << endl; - std::cout << "当程序加密文件或解密文件并且等待时,程序正在后台读取和写入文件。这个时候,永远不要关闭这个程序!\n否则您的数据被损坏并承担后果。建议您在进行数据备份之后,用这个程序加密文件或解密文件!\n" << endl; - system("pause"); - system("cls"); - - } - if (Instruction_Manual_Language == "MENU") - { - system("cls"); - goto ProgramMainMenu; - } - else - { - if (Instruction_Manual_Language != "enUS", "zhCN") - { - ConsoleTableColorSet(0, 0, 0); - goto Instruction_Manual_Language_Restart; - } - } - - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "4") - { - Clear_Workspace_Restart: - string Clear_Workspace; - system("color 0C"); - std::cout << "[警告!]即将进行的操作,会选中 文件夹,然后永久的删除所有数据!\n" << endl; - std::cout << "包括源文件、生成的加密文件、生成的解密文件、密码日志、配置\n" << endl; - std::cout << "如果你知道风险,请按键盘 [Y键继续 N键返回]\n[ Yes / No ]" << endl; - - std::cout << "[Warning!] The upcoming operation will select the and , and then permanently delete all the data!\n" << endl; - std::cout << "Including source files, generated encrypted files, generated decrypted files, password logs, configuration\n" << endl; - std::cout << "If you know the risk, press the keypad [Y key to continue N key to return]\n[Yes / No]" << endl; - std::cin >> Clear_Workspace; - - - if (Clear_Workspace == "N") - { - goto ProgramMainMenu; - } - if (Clear_Workspace == "n") - { - goto ProgramMainMenu; - } - if (Clear_Workspace == "Y") - { - DeleteFile(".\\SourceFileName_Temp.INI"); - DeleteFile(".\\SourceFileMainName_Temp.INI"); - DeleteFile(".\\SourceFileExtendedName_Temp.INI"); - - system("@Del /s /f /q .\\File-Key-Record-Log\\*.*"); - system("@Del /s /f /q .\\WorkPath\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Encrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\OutputFile\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Decrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\OutputFile\\*.*"); - - system("@Rmdir /s /q .\\File-Key-Record-Log\\"); - - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\"); - - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\"); - system("@Rmdir /s /q .\\WorkPath\\"); - - system("cls"); - - goto ProgramMainMenu; - - } - if (Clear_Workspace == "y") - { - DeleteFile(".\\SourceFileName_Temp.INI"); - DeleteFile(".\\SourceFileMainName_Temp.INI"); - DeleteFile(".\\SourceFileExtendedName_Temp.INI"); - - system("@Del /s /f /q .\\File-Key-Record-Log\\*.*"); - system("@Del /s /f /q .\\WorkPath\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Encrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\OutputFile\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Decrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\OutputFile\\*.*"); - - system("@Rmdir /s /q .\\File-Key-Record-Log\\"); - - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\"); - - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\"); - system("@Rmdir /s /q .\\WorkPath\\"); - - system("cls"); - - goto ProgramMainMenu; - - } - if (Clear_Workspace != "Y") - { - goto Clear_Workspace_Restart; - } - if (Clear_Workspace != "N") - { - goto Clear_Workspace_Restart; - } - if (Clear_Workspace != "y") - { - goto Clear_Workspace_Restart; - } - if (Clear_Workspace != "n") - { - goto Clear_Workspace_Restart; - } - - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "5") - { - return 0; - } - else - { - if (Load_User_Keyboard_Input != "1", "2", "3", "4") - { - ConsoleTableColorSet(0, 0, 0); - std::cout << "User Keyboard Input Error !" << endl; - getchar(); - exit(1); - } - } -} - -#include "Main_3_By_Twlilght_Yujiang.hpp" diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_3_By_Twlilght_Yujiang.hpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_3_By_Twlilght_Yujiang.hpp deleted file mode 100644 index 8a17106..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_3_By_Twlilght_Yujiang.hpp +++ /dev/null @@ -1,487 +0,0 @@ -/******************************************* -* 加密文件 -* -* E_SourceFileName 需要加密的文件名 -* E_KEY 密钥 -* E_TargetFileNewName 加密完成后要保存的文件名 -* -* @return 加密成功或失败的数字表示 -* -* 0 = 加密失败 -* 1 = 加密成功 -********************************************/ - - int RunEncryptFile(const char *E_SourceFileCharPath, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_KEY4, const char *E_TargetFileCharPath) - { - FILE *FilePointerSource, *FilePointerTarget; //需要打开的文件的指针 Need to open the file pointer - char buffer[1024]; //文件流缓冲区,用于存放从文件读取的数据 File stream buffer, used to store the data read from the file - - int FileByteData, //每次从文件中读取的字节数 The number of bytes read from the file each time - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(E_KEY), //密钥的长度 The length of the key - KeyLength2 = strlen(E_KEY2), - KeyLength3 = strlen(E_KEY3), - KeyLength4 = strlen(E_KEY4); - - FilePointerSource = fopen(E_SourceFileCharPath, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", E_SourceFileCharPath); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", E_SourceFileCharPath); - getchar(); - return 0; - } - - FilePointerTarget = fopen(E_TargetFileCharPath, "wb+"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", E_TargetFileCharPath); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", E_TargetFileCharPath); - getchar(); - return 0; - } - -/*加密算法开始*/ - -/*****************************************************************************buffer[RTNOC]******************************************************************************/ - -//运行大型加密模块 -//Run large encryption module - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - int NOIEM; //初始加密模块次数 (Number of initial encryption modules) - int MAX_NOT_E_MODULE = 66; //运行加密模块循环次数 (The maximum number of times the encryption module is running) - - for(NOIEM = 0;NOIEM < MAX_NOT_E_MODULE;NOIEM++) - { - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - - - - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥4在缓冲区中计算 -//The file and key4 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= E_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - }; - -/***********************************************************************************************************************************************************/ - -/*加密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(E_SourceFileCharPath); - - return 1; - } - - int RunDecryptFile(const char *D_SourceFileCharPath, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_KEY4, const char *D_TargetFileCharPath) - { - FILE *FilePointerSource, *FilePointerTarget; //需要打开的文件的指针 Need to open the file pointer - char buffer[1024]; //文件流缓冲区,用于存放从文件读取的数据 File stream buffer, used to store the data read from the file - - int FileByteData, //每次从文件中读取的字节数 The number of bytes read from the file each time - RTNOC, //运行循环次数 (Run The Number Of Cycles) - KeyLength = strlen(D_KEY), //密钥的长度 The length of the key - KeyLength2 = strlen(D_KEY2), - KeyLength3 = strlen(D_KEY3), - KeyLength4 = strlen(D_KEY4); - - FilePointerSource = fopen(D_SourceFileCharPath, "rb"); //以二进制方式读取文件 - if(FilePointerSource == NULL) - { - printf("File[%s]failed to open, please check whether the file path and name are entered correctly! \n", D_SourceFileCharPath); - printf("文件[%s]打开失败,请检查文件路径和名称是否输入正确!\n", D_SourceFileCharPath); - getchar(); - return 0; - } - - FilePointerTarget = fopen(D_TargetFileCharPath, "wb+"); //以二进制方式写入文件 - if(FilePointerTarget == NULL) - { - printf("File[%s]creation/write failed! Please check whether the file path and name are entered correctly!\n", D_TargetFileCharPath); - printf("文件[%s]创建/写入失败!请检查文件路径和名称是否输入正确!\n", D_TargetFileCharPath); - getchar(); - return 0; - } - -/******************************************* -* 解密文件 -* -* D_SourceFileName 需要解密的文件名 -* D_KEY 密钥 -* D_TargetFileNewName 解密完成后要保存的文件名 -* -* @return 解密成功或失败的数字表示 -* -* 0 = 解密失败 -* 1 = 解密成功 -********************************************/ - -/*解密算法开始*/ - -/***********************************************************************************************************************************************************/ - -//运行大型解密模块 -//Run large decryption module - -//文件和密钥在缓冲区中计算 -//The file and key are counted in Buffer - - int NOIDM; //初始解密模块次数 (Number of initial decryption modules) - int MAX_NOT_D_MODULE = 66; //运行解密模块循环次数 (The maximum number of times the decryption module is running) - - for(NOIDM = 0;NOIDM < MAX_NOT_D_MODULE;NOIDM++) - { - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - - -//文件和密钥2在缓冲区中计算 -//The file and key2 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength2, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength2 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY2[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥3在缓冲区中计算 -//The file and key3 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength3, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength3 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY3[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - -//文件和密钥4在缓冲区中计算 -//The file and key4 are counted in Buffer - - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递减运算 - { - buffer[RTNOC] -= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递除运算 - { - buffer[RTNOC] /= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行异或运算 - { - buffer[RTNOC] ^= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递乘运算 - { - buffer[RTNOC] *= D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - while((FileByteData = fread(buffer, 16, KeyLength4, FilePointerSource)) > 0) //不断地从文件中读取 KeyLength4 长度的数据,保存到buffer,直到文件结束 - { - for(RTNOC = 0; RTNOC < FileByteData; RTNOC++) //对buffer中的数据逐字节的和E_KEY进行递增运算 - { - buffer[RTNOC] += D_KEY4[RTNOC]; - } - fwrite(buffer, 16, FileByteData, FilePointerTarget); //将buffer中的数据写入文件 - } - }; - -/***********************************************************************************************************************************************************/ - -/*解密算法结束*/ - - fclose(FilePointerSource); - fclose(FilePointerTarget); - - DeleteFile(D_SourceFileCharPath); - - return 1; - } diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.cpp b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.cpp deleted file mode 100644 index 3fc52ac..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/Main_EODF3_By_Twlilght_Yujiang.cpp +++ /dev/null @@ -1,764 +0,0 @@ -/**************************************************************************** -Read Me - About This Source Code File - -Chinese中文: -计算机语言类型: C++ -程序文件名: Twlilght_Yujiang_File_Lock -程序平台类型: Windows 命令行控制台 -程序实际作用: 文件对称式加密解密 -版本: Beta 3.0 -源代码修改时间: 2017-8-14 -作者:Twlilght_Yujiang - -English英文: -Chinese -Computer Language Type: C ++ -Program File Name: Twlilght_Yujiang_File_Lock -Program Platform Type: Windows Command Line Console -The actual role of the program: file symmetric encryption and decryption -Version: Beta 3.0 -Source code modified by: 2017-8-14 -Author: Twlilght_Yujiang -*****************************************************************************/ - -#include -#include -#include -#include //计算机C语言标准输入输出函数 Computer C language standard input and output functions -#include //计算机C语言标准库函数 Computer C language standard library functions -#include //计算机C语言字符串处理函数 Computer C language string handling functions -#include -#include "stdafx.h" - -//#include //MakeSureDirectoryPathExists(""); -//#pragma comment(lib, "ImageHlp.lib") - -using namespace std; - -//typedef unsigned char byte; - -int RunEncryptFile(const char *E_SourceFileCharPath, char *E_KEY, char *E_KEY2, char *E_KEY3, char *E_KEY4, const char *E_TargetFileCharPath); -int RunDecryptFile(const char *D_SourceFileCharPath, char *D_KEY, char *D_KEY2, char *D_KEY3, char *D_KEY4, const char *D_TargetFileCharPath); - -//以下变量,应用到文件被加密时 -//The following variables apply when the file is encrypted -//***声明代码-开始 Declare the code - the beginning*** -string E_IF_PATH = ".\\WorkPath\\Encrypt\\InputFile\\", //加密之前,文件的路径 Before encrypting the path of the file -E_OF_PATH = ".\\WorkPath\\Encrypt\\OutputFile\\"; //加密之后,文件的路径 After encrypting the path of the file - -string E_SourceFileName, // 源文件名 -E_SourceFileMainName, // 源文件主要名 -E_SourceFileExtendedName, // 源文件扩展名 -E_TargetFileExtendedName; // 目标文件扩展名 - -char E_KEY[256], //File (Encryption or Encrypted) key 文件加密密钥 -E_KEY2[256], -E_KEY3[256], -E_KEY4[256]; -//***声明代码-结束 Declare the code - end*** - -//以下变量,应用到文件被解密时 -//The following variables apply when the file is decrypted -//***声明代码-开始 Declare the code - the beginning*** -string D_IF_PATH = ".\\WorkPath\\Decrypt\\InputFile\\", //解密之前,文件的路径 Before decrypting the path of the file -D_OF_PATH = ".\\WorkPath\\Decrypt\\OutputFile\\"; //解密之后,文件的路径 After decrypting the path of the file - -string D_SourceFileName, //源文件名 -D_TargetFileMainName, //目标文件主要名 -D_TargetFileTempName, //目标文件临时添加名 -D_TargetFileExtendedName; //目标文件源扩展名 - -char D_KEY[256], //File (Decryption or Decrypted) key 文件解密密钥 -D_KEY2[256], -D_KEY3[256], -D_KEY4[256]; -//***声明代码-结束 Declare the code - end*** - -/****************************************************************************************************************************************************************/ - -void ConsoleTableColorSet(int R, int G, int B) -{ - if (R < 0) R = 0; - if (R > 1) R = 1; - - if (G < 0) G = 0; - if (G > 1) G = 1; - - if (B < 0) B = 0; - if (B > 1) B = 1; - - if (R == 1 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); - } - else if (R == 1 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN); - } - else if (R == 1 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE); - } - else if (R == 0 && G == 1 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE); - } - else if (R == 1 && G == 0 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); - } - else if (R == 0 && G == 1 && B == 0) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN); - } - else if (R == 0 && G == 0 && B == 1) - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE); - } - else - { - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY); - } -} - -int main() -{ - ProgramMainMenu: - - string Load_User_Keyboard_Input; - - system("color 0A"); - system("cls"); - - std::cout << "----------------------------------------" << endl; - std::cout << "Enter 1 Encrypt File" << endl; - std::cout << "1.加密文件\n" << endl; - std::cout << "Enter 2 Decrypt File" << endl; - std::cout << "2.解密文件\n" << endl; - std::cout << "Enter 3 Use The Information Manual" << endl; - std::cout << "3.使用信息说明手册\n" << endl; - std::cout << "Enter 4 Clean Up The Workspace[To Restore The Initial State]" << endl; - std::cout << "4.清理工作空间[恢复初始状态]\n" << endl; - std::cout << "Enter 5 Exit Program" << endl; - std::cout << "5.退出程序\n" << endl; - std::cout << "----------------------------------------" << endl; - std::cout << "System:Input And Output/Enter>"; - - std::cin >> Load_User_Keyboard_Input; - getchar(); - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "1") - { - if (!access(".\\WorkPath\\Encrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 20%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Encrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 40%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\OutputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 60%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 80%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\OutputFile\\"); - } - - if (!access(".\\File-Key-Record-Log\\", 0)) - { - std::cout << "Building and Loading Folder 100%" << endl; - } - else - { - system("@Mkdir .\\File-Key-Record-Log\\"); - } - - system("cls"); - system("color 1A"); - - ConsoleTableColorSet(0, 0, 0); - std::cout << "Please input >>> the source file name + file extension name.\nDo not enter spaces!\n:" << endl; - std::cout << "输入要加密的文件名+文件扩展名,不要输入空格!" << endl; - std::cin >> E_SourceFileName; - - std::cout << "Please input >>> the source file name, not the file extension name!\nDo not enter spaces!\n:" << endl; - std::cout << "输入要加密的文件主要名,不是文件扩展名!不要输入空格!" << endl; - std::cin >> E_SourceFileMainName; - - std::cout << "Please input >>> the file extension name.\nDo not enter spaces!\n:" << endl; - std::cout << "输入要加密的文件扩展名,不要输入空格!" << endl; - std::cin >> E_SourceFileExtendedName; - system("cls"); - - std::cout << "正在记录并导出,源文件名称......\n[警告!]在进行本次操作后,请下次选择同样名称的加密文件,进行解密文件操作!\n否则,在那之前,请立即禁止使用加密文件功能!" << endl; - std::cout << "Recording and exporting, source file name......\n[Warning!]After doing this operation, please select the same name next time the encrypted file, decrypt the file operation!\nOtherwise, before that, please immediately disable the use of encrypted file function" << endl; - std::cout << "您是否接受这个协议?[键盘Enter继续] 或者 [关闭程序]......" << endl; - std::cout << "Whether you accept this agreement?[Keyboard Enter Continue] Or [Close this program]......" << endl; - - system("pause"); - system("cls"); - - ofstream SourceFileNameTempOutput; - SourceFileNameTempOutput.open(".\\SourceFileName_Temp.INI"); - SourceFileNameTempOutput << E_SourceFileName << endl; - SourceFileNameTempOutput.close(); - SourceFileNameTempOutput.open(".\\SourceFileMainName_Temp.INI"); - SourceFileNameTempOutput << E_SourceFileMainName << endl; - SourceFileNameTempOutput.close(); - SourceFileNameTempOutput.open(".\\SourceFileExtendedName_Temp.INI"); - SourceFileNameTempOutput << E_SourceFileExtendedName << endl; - SourceFileNameTempOutput.close(); - - //加密密钥码是用户自己定义的,(长度小于256)。可以任意的给一个需要加密的文件添加一个或多个加密密钥码 - //Encryption key code is user-defined, (length less than 256). You can optionally add one or more encryption keys to the one files you want to encrypt - E_KEY_LENTH_IS_INCORRECT: - int E_KEY_CODE_MAX_LENGTH = 256; - - ConsoleTableColorSet(0, 0, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥,不要输入空格!" << endl; - std::cout << "Please input >>> the key,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY; - if(strlen(E_KEY) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY,NULL,sizeof(E_KEY)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(0, 1, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥2,不要输入空格!" << endl; - std::cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY2; - if(strlen(E_KEY2) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY2,NULL,sizeof(E_KEY2)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥2的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key2 length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(0, 1, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥3,不要输入空格!" << endl; - std::cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY3; - if(strlen(E_KEY3) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY3,NULL,sizeof(E_KEY3)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥3的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key3 length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥4,不要输入空格!" << endl; - std::cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> E_KEY4; - if(strlen(E_KEY4) > E_KEY_CODE_MAX_LENGTH) - { - memset(E_KEY4,NULL,sizeof(E_KEY4)); //Reset This Variable The Value (NULL = 0) - std :: cout << "加密密钥4的长度,已经超过256位字符。 请重新输入所有加密密钥!" << endl; - std :: cout << "Encryption key4 length, has more than 256 characters. Please re-enter the all encryption key!" << endl; - system("pause"); - goto E_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 1); - std::cout << "\n"; - std::cout << "Please output >>> file extension name.\nDo not enter spaces!\n[.TSMY-ENCRYPTED]:" << endl; - std::cout << "输出文件扩展名,不要输入空格[.TSMY-ENCRYPTED]:" << endl; //给加密后的文件输出文件扩展名,并保存 Export the file extension to the encrypted file and save it - std::cin >> E_TargetFileExtendedName; - if (E_TargetFileExtendedName == " ") - { - string E_TargetFileAddExtendedName = ".TSMY-ENCRYPTED"; - E_TargetFileExtendedName = E_TargetFileAddExtendedName; - } - - system("cls"); - - string E_SourceFileStringPath = E_IF_PATH + E_SourceFileName; - string E_TargetFileStringPath = E_OF_PATH + E_SourceFileName + E_TargetFileExtendedName; - - const char *E_SourceFileCharPath = E_SourceFileStringPath.c_str(); - const char *E_TargetFileCharPath = E_TargetFileStringPath.c_str(); - - /*char *E_SourceFileLastNameOutput; //最后读写的文件名 - strcpy(E_SourceFileLastNameOutput,E_SourceFileCharPath); - char *E_TargetFileLastNameOutput; //最后保存的加密后文件名 - strcpy(E_TargetFileLastNameOutput,E_TargetFileCharPath);*/ - - ConsoleTableColorSet(1, 1, 0); - std::cout << "正在记录并导出,本次用于文件加密,4个密钥字符串......" << endl; - std::cout << "Is being recorded and exported, this time for file encryption, 4 key string......" << endl; - ofstream PasswordOutputKeyFile; - PasswordOutputKeyFile.open(".\\File-Key-Record-Log\\ENCRYPTION-DECRYPTIPN-PASSWORD.KEY.TXT"); - PasswordOutputKeyFile << "Twlilght_Yujiang File Lock Password [Key String] Save\n" << endl; - PasswordOutputKeyFile << "\n" << endl; - PasswordOutputKeyFile << "Source Input File Name and Path: " << E_SourceFileStringPath << "\n" << endl; - PasswordOutputKeyFile << "EncryptFile: New Output Target File Name and Path: " << E_TargetFileStringPath << "\n" << endl; - PasswordOutputKeyFile << "Key string1 [Password1]: " << E_KEY << "\n" << endl; - PasswordOutputKeyFile << "Key string2 [Password2]: " << E_KEY2 << "\n" << endl; - PasswordOutputKeyFile << "Key string3 [Password3]: " << E_KEY3 << "\n" << endl; - PasswordOutputKeyFile << "Key string4 [Password4]: " << E_KEY4 << "\n" << endl; - PasswordOutputKeyFile << "<******************************************************************************************>" << "\n" << endl; - PasswordOutputKeyFile.close(); - - ConsoleTableColorSet(1, 1, 1); - std::cout << "Please wait, read and write in the file......" << endl; - std::cout << "请等待,文件读写中......" << endl; - getchar(); - - if (RunEncryptFile(E_SourceFileCharPath, E_KEY, E_KEY2, E_KEY3, E_KEY4, E_TargetFileCharPath)) - { - printf("恭喜你,文件[%s]加密成功,保存在[%s]。\n", E_SourceFileCharPath, E_TargetFileCharPath); - printf("Congratulations, the file [%s] is encrypted successfully, saved in [%s]. \n", E_SourceFileCharPath, E_TargetFileCharPath); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "2") - { - if (!access(".\\WorkPath\\Encrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 20%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Encrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 40%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Encrypt\\OutputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\InputFile\\", 0)) - { - std::cout << "Building and Loading Folder 60%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\InputFile\\"); - } - - if (!access(".\\WorkPath\\Decrypt\\OutputFile\\", 0)) - { - std::cout << "Building and Loading Folder 80%" << endl; - } - else - { - system("@Mkdir .\\WorkPath\\Decrypt\\OutputFile\\"); - } - - if (!access(".\\File-Key-Record-Log\\", 0)) - { - std::cout << "Building and Loading Folder 100%" << endl; - } - else - { - system("@Mkdir .\\File-Key-Record-Log\\"); - } - - system("cls"); - system("color 1A"); - - ConsoleTableColorSet(1, 1, 1); - std::cout << "Please input >>> the source file name + file extension name.\nDo not enter spaces!\n:" << endl; - std::cout << "输入要解密的文件名+文件扩展名,不要输入空格!" << endl; - std::cin >> D_SourceFileName; - - //解密密钥码是由用户自己在加密文件步骤设置的。这个定义,来自被加密密钥码的操作过的二进制文件(说明:解密密钥码等于加密密钥码)。你可以给任意一个需要解密的文件,输入正确的解密密钥码 - //The decryption key code is set by the user himself at the encrypted file step. This definition, from the encrypted key code of the operation of the binary file (Description: decryption key code is equal to the encryption key code). You can give a random file to be decrypted and enter the correct decryption key code - D_KEY_LENTH_IS_INCORRECT: - int D_KEY_CODE_MAX_LENGTH = 256; - - ConsoleTableColorSet(1, 1, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥,不要输入空格!" << endl; - std::cout << "Please input >>> the key3,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY; - if(strlen(D_KEY) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY,NULL,sizeof(D_KEY)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥2,不要输入空格!" << endl; - std::cout << "Please input >>> the key2,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY2; - if(strlen(D_KEY2) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY2,NULL,sizeof(D_KEY2)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥2的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key2 length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(1, 0, 0); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥3,不要输入空格!" << endl; - std::cout << "Please input >>> the key,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY3; - if(strlen(D_KEY3) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY3,NULL,sizeof(D_KEY3)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥3的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key3 length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - ConsoleTableColorSet(0, 1, 1); - std::cout << "\n"; - std::cout << "输入(长度小于256)密钥4,不要输入空格!" << endl; - std::cout << "Please input >>> the key,Do not enter spaces!\n(length less than 256):" << endl; - std::cin >> D_KEY4; - if(strlen(D_KEY4) > D_KEY_CODE_MAX_LENGTH) - { - memset(D_KEY4,NULL,sizeof(D_KEY4)); //Reset This Variable The Value (NULL = 0) - std :: cout << "解密密钥4的长度,已经超过256位字符。 请重新输入所有解密密钥!" << endl; - std :: cout << "Decryption key4 length, has more than 256 characters. Please re-enter the all decryption key!" << endl; - system("pause"); - goto D_KEY_LENTH_IS_INCORRECT; - } - - system("cls"); - - ConsoleTableColorSet(0, 1, 0); - - std::cout << "\n"; - std::cout << "如果在当前文件夹下配置文件[.\\*.INI]不存在,程序就不会帮您自动恢复原来的文件名称。\n你需要重新输入文件名!" << endl; - std::cout << "If the configuration file [.\\*.INI] does not exist in the current folder, the program will not automatically restore the original file name.\nYou need to re-enter the file name!" << endl; - std::cout << "Please output >>> target file main name,not the file extension name!\nDo not enter spaces!\n[DATA-DECRYPTED]:" << endl; - std::cout << "输出文件主要名,不是文件扩展名,不要输入空格[DATA-TSMY-DECRYPTED]!" << endl; //给解密后的文件输出主要文件名,并保存 Output the main file name to the decrypted file and save it - if (!access(".\\SourceFileMainName_Temp.INI", 0)) - { - //char TFMN_Buffer[256]; - ifstream LoadSourceFileNameConfigure(".\\SourceFileMainName_Temp.INI", ios::in); - if (LoadSourceFileNameConfigure.fail()) - { - std::cout << "加载配置文件时,出现了未知错误并结束" << endl; - std::cout << "When the configuration file is loaded, an unknown error has occurred and ends" << endl; - } - while (!LoadSourceFileNameConfigure.eof()) - { - LoadSourceFileNameConfigure >> D_TargetFileMainName; - //LoadSourceFileNameConfigure.getline(TFMN_Buffer,256,'\n'); //getline(char *,int,char) 表示该行字符达到256个或遇到换行就结束 - //D_TargetFileMainName = TFMN_Buffer; - - std::cout << "您已成功跳过此步骤" << endl; - std::cout << "You have successfully skipped this step" << endl; - } - LoadSourceFileNameConfigure.close(); - } - else - { - std::cout << "配置文件" << ".\\SourceFileMainName_Temp.INI" << "未找到!\n" << "请重新输入名称!" << endl; - std::cout << "Configuration file" << ".\\SourceFileMainName_Temp.INI" << "Not found!\n" << "Please re-enter the name!" << endl; - HANDLE hFILE = CreateFile(".\\SourceFileMainName_Temp.INI", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - std::cin >> D_TargetFileMainName; - - } - - system("cls"); - - std::cout << "如果在当前文件夹下配置文件[.\\*.INI]不存在,程序就不会帮您自动恢复原来的文件名称。\n你需要重新输入文件名!" << endl; - std::cout << "If the configuration file [.\\*.INI] does not exist in the current folder, the program will not automatically restore the original file name.\nYou need to re-enter the file name!" << endl; - std::cout << "Please output >>> target file extension name!\nDo not enter spaces!\n[Example: .txt]:" << endl; - std::cout << "输出文件扩展名,不要输入空格[实例: .txt]!" << endl; //给解密后的文件输出文件扩展名,并保存 - if (!access(".\\SourceFileExtendedName_Temp.INI", 0)) - { - ifstream LoadSourceFileNameConfigure(".\\SourceFileExtendedName_Temp.INI", ios::in); - //char TFEN_Buffer[256]; - if (LoadSourceFileNameConfigure.fail()) - { - std::cout << "加载配置文件时,出现了未知错误并结束" << endl; - std::cout << "When the configuration file is loaded, an unknown error has occurred and ends" << endl; - } - while (!LoadSourceFileNameConfigure.eof()) - { - LoadSourceFileNameConfigure >> D_TargetFileExtendedName; - //LoadSourceFileNameConfigure.getline(TFEN_Buffer,256,'\n'); //getline(char *,int,char) 表示该行字符达到256个或遇到换行就结束 - //D_TargetFileExtendedName = TFEN_Buffer; - - std::cout << "您已成功跳过此步骤" << endl; - std::cout << "You have successfully skipped this step" << endl; - } - LoadSourceFileNameConfigure.close(); - } - else - { - std::cout << "配置文件" << ".\\SourceFileExtendedName_Temp.INI" << "未找到!\n" << "请重新输入名称!" << endl; - std::cout << "Configuration file" << ".\\SourceFileExtendedName_Temp.INI" << "Not found!\n" << "Please re-enter the name!" << endl; - HANDLE hFILE = CreateFile(".\\SourceFileExtendedName_Temp.INI", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - std::cin >> D_TargetFileExtendedName; - } - - system("cls"); - - std::cout << "\n"; - std::cout << "如果在当前文件夹下配置文件[.\\*.INI]不存在,程序就不会帮您自动恢复原来的文件名称。\n你需要重新输入文件名!" << endl; - std::cout << "If the configuration file [.\\*.INI] does not exist in the current folder, the program will not automatically restore the original file name.\nYou need to re-enter the file name!" << endl; - std::cout << "Please output >>> target file temp add name.\nDo not enter spaces!\n[-DECRYPTED]:" << endl; - std::cout << "输出文件临时添加名,不要输入空格[-TSMY-DECRYPTED]!" << endl; //给解密后的文件输出文件临时添加名,并保存 - std::cout << "Prevent source encrypted files from being overwritten" << endl; - std::cout << "防止源加密文件被覆盖" << endl; - std::cin >> D_TargetFileTempName; - if (D_TargetFileTempName == " ") - { - string D_TargetFileAddName = "-TSMY-DECRYPTED"; - D_TargetFileTempName = D_TargetFileAddName; - } - - system("cls"); - - string D_SourceFileStringPath = D_IF_PATH + D_SourceFileName; - string D_TargetFileStringPath = D_OF_PATH + D_TargetFileMainName + D_TargetFileTempName + D_TargetFileExtendedName; - - const char *D_SourceFileCharPath = D_SourceFileStringPath.c_str(); - const char *D_TargetFileCharPath = D_TargetFileStringPath.c_str(); - - /*char *D_SourceFileLastNameOutput; //最后读写的文件名 - strcpy(D_SourceFileLastNameOutput,D_SourceFileCharPath); - char *D_TargetFileLastNameOutput; //最后临时保存的解密后的文件名 - strcpy(D_TargetFileLastNameOutput,D_TargetFileCharPath);*/ - - ConsoleTableColorSet(0, 0, 1); - std::cout << "Please wait, read and write in the file......" << endl; - std::cout << "请等待,文件读写中......" << endl; - getchar(); - - if (RunDecryptFile(D_SourceFileCharPath, D_KEY, D_KEY2, D_KEY3, D_KEY4, D_TargetFileCharPath)) - { - printf("恭喜你,文件[%s]解密成功,保存在[%s]。\n", D_SourceFileCharPath, D_TargetFileCharPath); - printf("Congratulations, the file [%s] is decrypted successfully, saved in [%s]. \n", D_SourceFileCharPath, D_TargetFileCharPath); - getchar(); - system("pause"); - system("cls"); - goto ProgramMainMenu; - } - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "3") - { - Instruction_Manual_Language_Restart: - system("cls"); - std::cout << "欢迎你的到来! 这是本程序的说明手册[Beta Version 3.0],请务必在使用前,仔细阅读" << endl; - std::cout << "Welcome to your arrival! This is the instruction manual [Beta Version 3.0] of this program, please be sure to read carefully before using it" << endl; - std::cout << "" << endl; - std::cout << "enUS----------English 英文" << endl; - std::cout << "zhCN----------Chinese 中文" << endl; - std::cout << "MENU----------Back Main Menu 返回主菜单" << endl; - string Instruction_Manual_Language; - std::cin >> Instruction_Manual_Language; - if (Instruction_Manual_Language == "enUS") - { - system("cls"); - system("color 67"); - std::cout << "When the program executes the function of encrypting the file or decrypting the file, it will create the workspace folder, input the folder, output the folder.\n" << endl; - std::cout << "When the program encrypts the file or decrypts the file and waits, the program is reading and writing the file in the background.\nNever close the program at this time! Otherwise your data is damaged and bear the consequences.\nIt is recommended that you after the data backup, use this program to encrypt the file or decrypt the file!\n" << endl; - system("pause"); - system("cls"); - } - if (Instruction_Manual_Language == "zhCN") - { - system("cls"); - system("color 17"); - std::cout << "当程序执行加密文件或解密文件的功能时,将创建工作空间文件夹,输入文件夹,输出文件夹。\n" << endl; - std::cout << "当程序加密文件或解密文件并且等待时,程序正在后台读取和写入文件。这个时候,永远不要关闭这个程序!\n否则您的数据被损坏并承担后果。建议您在进行数据备份之后,用这个程序加密文件或解密文件!\n" << endl; - system("pause"); - system("cls"); - - } - if (Instruction_Manual_Language == "MENU") - { - system("cls"); - goto ProgramMainMenu; - } - else - { - if (Instruction_Manual_Language != "enUS", "zhCN") - { - ConsoleTableColorSet(0, 0, 0); - goto Instruction_Manual_Language_Restart; - } - } - - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "4") - { - Clear_Workspace_Restart: - string Clear_Workspace; - system("color 0C"); - std::cout << "[警告!]即将进行的操作,会选中 文件夹,然后永久的删除所有数据!\n" << endl; - std::cout << "包括源文件、生成的加密文件、生成的解密文件、密码日志、配置\n" << endl; - std::cout << "如果你知道风险,请按键盘 [Y键继续 N键返回]\n[ Yes / No ]" << endl; - - std::cout << "[Warning!] The upcoming operation will select the and , and then permanently delete all the data!\n" << endl; - std::cout << "Including source files, generated encrypted files, generated decrypted files, password logs, configuration\n" << endl; - std::cout << "If you know the risk, press the keypad [Y key to continue N key to return]\n[Yes / No]" << endl; - std::cin >> Clear_Workspace; - - - if (Clear_Workspace == "N") - { - goto ProgramMainMenu; - } - if (Clear_Workspace == "n") - { - goto ProgramMainMenu; - } - if (Clear_Workspace == "Y") - { - DeleteFile(".\\SourceFileName_Temp.INI"); - DeleteFile(".\\SourceFileMainName_Temp.INI"); - DeleteFile(".\\SourceFileExtendedName_Temp.INI"); - - system("@Del /s /f /q .\\File-Key-Record-Log\\*.*"); - system("@Del /s /f /q .\\WorkPath\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Encrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\OutputFile\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Decrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\OutputFile\\*.*"); - - system("@Rmdir /s /q .\\File-Key-Record-Log\\"); - - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\"); - - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\"); - system("@Rmdir /s /q .\\WorkPath\\"); - - system("cls"); - - goto ProgramMainMenu; - - } - if (Clear_Workspace == "y") - { - DeleteFile(".\\SourceFileName_Temp.INI"); - DeleteFile(".\\SourceFileMainName_Temp.INI"); - DeleteFile(".\\SourceFileExtendedName_Temp.INI"); - - system("@Del /s /f /q .\\File-Key-Record-Log\\*.*"); - system("@Del /s /f /q .\\WorkPath\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Encrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Encrypt\\OutputFile\\*.*"); - - system("@Del /s /f /q .\\WorkPath\\Decrypt\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\InputFile\\*.*"); - system("@Del /s /f /q .\\WorkPath\\Decrypt\\OutputFile\\*.*"); - - system("@Rmdir /s /q .\\File-Key-Record-Log\\"); - - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Encrypt\\"); - - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\OutputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\InputFile\\"); - system("@Rmdir /s /q .\\WorkPath\\Decrypt\\"); - system("@Rmdir /s /q .\\WorkPath\\"); - - system("cls"); - - goto ProgramMainMenu; - - } - if (Clear_Workspace != "Y") - { - goto Clear_Workspace_Restart; - } - if (Clear_Workspace != "N") - { - goto Clear_Workspace_Restart; - } - if (Clear_Workspace != "y") - { - goto Clear_Workspace_Restart; - } - if (Clear_Workspace != "n") - { - goto Clear_Workspace_Restart; - } - - } - -/****************************************************************************************************************************************************************/ - - if (Load_User_Keyboard_Input == "5") - { - return 0; - } - else - { - if (Load_User_Keyboard_Input != "1", "2", "3", "4") - { - ConsoleTableColorSet(0, 0, 0); - std::cout << "User Keyboard Input Error !" << endl; - getchar(); - exit(1); - } - } -} - -#include "EODF3_By_Twlilght_Yujiang.hpp" diff --git a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/StdAfx.h b/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/StdAfx.h deleted file mode 100644 index e87646a..0000000 --- a/[Encrypt_Or_Decrypt_File]-Source-Code/Beta-Version3/StdAfx.h +++ /dev/null @@ -1,32 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_) -#define AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define DLLEXPORT __declspec(dllexport) -#define DLLIMPORT __declspec(dllimport) - -#include "stdio.h" -#include -#include -#include - -#pragma comment(lib,"ws2_32.lib") - -// TODO: reference additional headers your program requires here -void Msg(char *szFormat, ...); -void dbMsg(char *szFormat, ...); -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__4607A810_33E2_483D_80D8_BE41F0D473D5__INCLUDED_)