我发现此代码用于将文本输入直接替换为您定义的其他一些字符,因为@Aacini修改了简单的加密/解密方法代码 问题是当我尝试编码某些目录时 “ C:\ Program Files(x86)\ Adobe” 会导致
7EzkSw]8Z8KFSBheZL4HXWPj5mZda7tFXveyJHXWPj5qFYBS6qYAnsbZFXRRgWua5CW65QMWuezmzLx6ry4ReEfnPAxZFXRRgv275kQHhRN7HvvpYPWAd2Kj88Z8KFSqFYBS6NF7SQUmZda7tYrGxPa6ry4Re
问题是它永远不会编码冒号:
我如何手动输入数据中定义的冒号代码:= xU9pbp进行解密,它将解密冒号值
仅加密问题会导致[]产生7EzkSw]
C
代码
@echo off
setlocal EnableDelayedExpansion
title Encrypt and decrypt string
color a
rem Create Encrypt/Decrypt arrays
set "charSet=abcdefghijklmnopqrstuvwxyz1234567890@#$*(.,- \/:"
set i=0
for %%a in (
qFYBS6 YrGxPa 7EzkSw NF7SQU 6ry4Re
Wua5CW FXveyJ TjMmgD 65QMWu GkmBEE
KXNe9s ezmzLx qYAnsb dd4PWp mZda7t
BheZL4 WUmv8U HXWPj5 EfnPAx kBEypV
tDNJde zxNvTT YJ5Pms HhRN7H Vkh3EX
4WfDP3 EQUgc5 abYL93 EBLCJa xEgKbW
Z6QA9U Ad2Kj8 zRDwx9 vvpYPW ms499B
55FGHB eu3RA9 FSYKz9 KsTuqW ETjRHF
v275kQ KUngv8 2Z9ba8 Xtxkzp ZFXRRg
8Z8KFS a2yjt4 xU9pbp) do (
for %%i in (!i!) do for /F "delims=" %%c in ("!charSet:~%%i,1!") do (
set "ENC[%%c]=%%a"
set "DEC[%%a]=%%c"
)
set /A i+=1
)
echo Enter a string to encrypt:
set /p Encrypt=
REM cls
set Encrypt2=%Encrypt%
set "EncryptOut="
:encrypt2
set "EncryptOut=%EncryptOut%!ENC[%Encrypt2:~0,1%]!"
set "Encrypt2=%Encrypt2:~1%"
if defined Encrypt2 goto encrypt2
echo %EncryptOut%>>"encrypted.txt"
echo/
set /p CryptedPass=< "encrypted.txt"
echo Input string clear text ===^> %Encrypt%
echo/
echo Output string crypted ===^> %CryptedPass%
pause
set /p Decrypt=<"encrypted.txt"
REM cls
ECHO/
ECHO/
set Decrypt2=%Decrypt%
set "DecryptOut="
:decrypt2
set "DecryptOut=%DecryptOut%!DEC[%Decrypt2:~0,6%]!"
set "Decrypt2=%Decrypt2:~6%"
if defined Decrypt2 goto decrypt2
echo Input string: %Decrypt%
echo/
echo Output string: %DecryptOut%
pause
答案 0 :(得分:0)
我遇到了这样的问题,尝试将输出中的]替换为冒号,然后将其保存,这是成功的,因为当再次解码时,路径又回到冒号的原始位置:i