-
- @echo off&setlocal enabledelayedexpansion
- set x=ABCDEFGHIJKLMNOPQRSTUVWXYZ
- set miwen=&set yum=miwen
- for /l %%a in (0 1 25) do (
- set /a n=%%a+1,#!x:~%%a,1!=n
- set #!n!=!x:~%%a,1!
- )
- set /p my=请输入密匙
- set /p mw=请输入明文
- set m=0
- :lp
- set/a mm=m+99
- for /l %%a in (!m!,1,!mm!) do (
- for %%b in (!yum!) do (
- set miwen=!miwen!!#%%b!
- if "!mw:~%%a!" equ "" goto :ok
- set /a "yum=(#!my:~0,1!+#!mw:~%%a,1!+24)%%26+1",m=%%a+1
- set my=!my:~1!!my:~0,1!
- )
- )
- goto :lp
- :ok
- echo 密文: !miwen!
- pause
复制代码
[ 本帖最后由 netbenton 于 2009-5-14 12:54 编辑 ] |