使用CPA4破解经典密码算法
下面是一段经过经典密码算法加密的密文(加密算法未知):
yvvnerujjvnywhbdvkpchfgvjtzwqsuporqfzpoekkjgziicdwwkeejdsruef
whwseyejejhnaeepjbjwnuztavjswrthswlcdxqrnoclsodkrrfjtfhlfznbx
wyvdwdcwyzqlqrnevuiiienxzmwtdsyhgstwmvznrvhyihhcxjijhiojphvjw
srpejwnhrhirqbcdwnzqmwjpoibnbjdeshloewcfdhvzjgtdwsvntydyweyll
gjrrohfuyplppzrssvniejxhzjtrwyvvdecpttrieevhzlxsvunstovzwjfsa
svlsgzjcvwmseioidhsywsddisrjadhkcideivjzwwsfqjcwphvwtdtkatkjg
zjwfpjbjbofwgochaegfhmyodpjbkwtfukcixokkrseoaegbcdanjitckxaco
xvvdajdqgfxetrrskdewlwgketronoesoddshfxezqiitpeulshfdeiftiepr
pvkcfpbroqwechroqcwbadhfbuwlcwmokshzojkfnkzqlojhanbjfzjhvuxdr
neklrskdezqiswwtzjfpcamfufqvolrwjgkreewzfvesrvftzbauhasckpdhs
hzjskuzqkkrydawecjlvyqfjdlfysuwcfxwgvhajwbsvgbvwbsvjaegtqkkbv
ufhkdezufbzwnwrthswlcdhouamplshvdrrqyvvnejkjhiwiehiwiwnzdskfi
eershyatvfmbzyacdxdvytjrkqfwcylsunkmvqxtfktsdqzektaxxhwkokefz
cxukvustefzffzcuwfpjbjbofwgochwyrjjvnsrbxhywtkkjavjsxdrsrjdkk
jkfieevlodaaihyvvoadhmojylvdwzpjemhwkfnkvgnbrlrfijgjeoedqseri
irsavjtjkjhfhdwlkotkmrvritdajztavjswrthswlckfgxnonqtjvntyhqoj
pfvzistwdvvnhywsewgstkmvdsmdkrvvnazhaiwthyamvqxurienrrsewrvsm
mjecroqmuefwhwseptfpjbrjdkkjafnekkjkfieevlodadvyjzflskkjafnez
wngwqlcrkggaczinqzpivvyvrprvtzwiaaulktvneewfdgnorfmtikmrftotd
jlvyzzgejddwerocojmswlcrwprokvwgochtyhwsjjogrnbkenxutigenxlyo
chuegjfkdejdrstwtvjtfpphvrgjzkujsmmjecroiwwbeihsqvoaihtbcutyh
xhrntzqldfenkwmswkrdhwgknibhwocoogrnbkotfnjmkwcklhocziwijfvjc
vvfbuprrlswecmvwmcuotrnjomarpvnaghevafaghekkjdzcgplshyamzgizv
zrzoqgjdetrshzjuvgdclnedraskdakiwcdwmvqxhiwielsujasjltbrjdprz
fvhojwbvvnervlsearroqmjlernnbxbeddqsghaphwguknkwjbupotdwsrxol
wyvzokzqicwyodsjhzpimhssjoiedboiiugptfryeyrusjphrwismalfsrsep
ielywrpimhxzzgekkjkfieevkcfpbroqqfwcylsutkuivjwepeyufbnditkbo
jwtkhsrvzbpztavjoeodkzhlyhqdkknruwcnphvjfdsatnhjbkdefsucipuel
ywvoawitfuadkrrocaaegksdwlvftotdejrkqfqrjhdcldamhlfvwttrfqyas
kkfhljdvuxhrjdkkjkfieevlodalznjoepoeltqrxrzqnweetrodcilhzondg
abvulsikozqkfrjcvvfwuioidhssqtnkfhjprznjgdaijzmseoodhysrisfuh
zlxstktcjahvdiqfwcyhxbfpbrvjrfjaivzafneosjfzanthgikkncbgstwuj
hyvvuhrsuseposhrsewszvfwuxewrwskdexdrszodziksiankdsrkdakvhzvw
rkrjjvnyfqjplptyhtdgkrkxswkeejdktfndvgyctkatkjgjdoloibkxeulkt
vneewtdgkrkxswkeejitfrhlkkjufopvoyvrpmfufqvesgujotdiejnggwrkl
hicwrcbaocqasojwephvpnruhevdxhndeihqokalpztavjswrthswlckfgdwd
vgwodwtzfxhiedvvnfrjffujlripchkwvhdjztavjsedywfjacwjodofirroc
hcrwjufnivvxhrntzqlokqaegnhjjakltbrhlvdlivberwzfvotvdrgzjtyhk
wiotulawjeoedsrrjokkjfwevvlshyasvftbuzimlxwfjnfwycdankltbrpok
dqtlpsroysrisjswsrzatutgjboluiwwbeihshcaaxxjrzrijltbjwtwlwgkc
lrqhszpsvdxmwkrnhxhvnnjwthvjdkryvzjkkkfhkdijlxotkmgojhvhyulkt
vneewhicpuihgikdoehxhcuajdswkwlzdskywtjwwitgmvwmsdkskzjfvphvv
nazhailywvosrliafnathusfllvdwsnwrddsrrlpirfqywbchfbuphvujgekp
cdhsndeihyvrpijdxqcaaidxwebofwgochwydywjavzgjbkpodhnbkahidswj
wgzjfbkecgdxgzknwrwtfktsdqzrhemhqcwenkhwsjptydygknucbtikotrqi
wecsghhwwecroqmrioejyvvsodhshykuxknhjylvdwhywtkknggwsjltbtwri
ljgrlokhshzwlnknqyesfqqmekwshnbxqnkdudvzhfsjtlhlpwmwjyoluxszo
aelrdfntrqygkapkrboizskkngdwhuljafdadpfrbdaelfavibvuttkdezufb
zwnwdxkfieevhcdiikwjswqlcbfuiaejznhyphvitfdarzwfzpwnuffbrzatr
fqysodhsgwkokefzcdajiqclnijkjrzjrvfjbkueruxoeznfzfrruszwxhyam
fvydflucdwggkrkdrceciidswrjwfpjbjdejdnrzpsroxcfjefiyvvbamrzfz
pejstfkoffurijhidztavjbvffijatyhdoiaacotkvztfsqopshzojkvwrzql
oyaauvhoibmfkfadwdbkfbzwljrgsceemhxhywttrrpzjakltbfbdvyjzflmv
qyqfqrjhxoezeclystkmghywkeoevqwbanvaymvwrjintrqwfpjbjsoioiwef
oigfbkdewlwgksodhsgnkrcghigdecgnbkdedlircaervyoiatyhbopboizff
uboiwmsiagzrswkoaxujokkpgrwhljikbycrptidhhgqbclhcgenzrshfsodh
sgwkokefzcwnudqgfboiijarhedlircaervysijtvdrgkksyrbhyaiivyfvjg
Kkxoxwievywepeiqfhzknrotdgknvqygjdetrsqcqdvg
破解过程:
1.先确定是单表还是多表加密,通过统计字母频率
把密文复制到Ciphertext处,点击左侧Freq,就有统计字母频率的功能。
统计结果:
a 120 0.034
b 91 0.026
c 105 0.030
d 178 0.051
e 178 0.051
f 164 0.047
g 99 0.028
h 180 0.051
i 148 0.042
j 205 0.058
k 201 0.057
l 111 0.032
m 55 0.016
n 113 0.032
o 146 0.041
p 85 0.024
q 82 0.023
r 193 0.055
s 168 0.048
t 139 0.039
u 87 0.025
v 177 0.050
w 210 0.060
x 63 0.018
y 97 0.028
z 126 0.036
可以选择用图表的形式显示出来:
可以看到字母频率分布的较平均,没有某个字符概率很高或者概率很低,所以猜测这是一个多表加密的密文。(因为单表加密通常都会显示出语言的特征)
现在已经知道是多表加密了,那用的是哪种多表加密算法呢?
实际的办法就只能一个个尝试。
首先假设这是一个Vigenere密码算法加密的密文:
先要确定密钥的长度
用CAP的Kasiski,得知
String Distance
yvv 273
yvv 707
yvv 868
yvv 1953
yvv 2765
yvv 3101
Yvv出现的距离:434 595 1680 2492 2828
最大公约数是7
猜测密钥的长度是7
再用CAP的Low Freq
输入密钥的长度7,给出的可能密钥是forward。
用CAP的Vigenere Cipher,输入keyword:forward,给出的原文是
there are very few people as entitledtoanalysethesimilaritiesanddif
ferencesbetweenmensandwomensfootballascarolinamoracefollowing
ayearplayingcareerduringwhichshebecamewidelyrecognisedasthegr
eatestitalianwomaninhistoryinshebeganacoachingcareerthatinclu
dedashortbutpioneeringstintatthehelmofamensclubseriecsviterbe
seinsincethenmoracehasmadeanameforherselfasoneofthetopcoaches
inwomensfootballandatvcommentatorforbothmensandwomensfootball
shehasalsobecomethefirstitalianwomantobeinductedintohercountr
ysfootballinghalloffameandallthatwhileworkingaslawyerinherspa
retimetheindefatigablemoraceslatestventureisasafifadevelopmen
tinstructorhavingjustconductedacourselastweekbetweenandoctobe
rattheiranianfootballacademyintehranthereshetrainediranianwom
enonthetechnicalaspectsofcoachingwomensfootballnotjustfootbal
lbutspecificallywomensfootballwhoeversaysthatthemensgameandth
ewomensgamearethesamehasclearlyneverworkedinaprofessionalenvi
ronmentshetoldfifacomasmuchaswomensfootballhasgrownoverthelas
tfewdecadesithasntbecomeanymoresimilartothemensgamewomenareph
ysicallydifferenttomenandthemorethewomensgamedevelopsthemorei
tisfullofspecificitiesthatrequireadifferentapproachfromacoach
justlikesayinvolleyballorbasketballtheresnopointingroupingita
llunderthesamecategorytheobviousphysicaldifferencesareonlythe
startingpointtheformerstrikeralsopointstokeytacticaldifferenc
esandtrainingmethodstakeaverysimpleexamplethepiggyinthemiddle
drillsshecontinuedyouremovethatfromamenstrainingsessionandyou
relostwhereasgenerallyspeakingfemaleplayersdonttendtocareabou
tthiskindofcompetitivenessinawarmupmoracehopesthatdevelopment
initiativeslikethewomensfootballcoachingcourseintehranwhichwa
sattendedbywomenonlywillhelptonarrowthegapbetweentheopportuni
tiesaffordedtomaleandfemalecoachesofcourseyouhavegreatcoaches
thatunderstandthewomensgamelikeantoniocabriniinitalyorphilipp
ebergerooinfrancesaidmoracebutwhatstrikesmeiswhensometeamsorc
lubschooseheadcoachesnotbasedonarsumorexperiencebutonlybecaus
etheyhappentobemenasisaidbeforethegameisdifferentandthatsclea
rtoeveryonebuttheopportunitiesaffordedtocoachesshouldntbediff
erentopportunitiesforallthegospelthatmoraceispreachingisparti
cularlyvaluableinthemiddleeastwherelatelywomensfootballhasmad
edramaticstridesiranforexamplefieldswomensnationalteamsfromal
lcategoriesstartingatuanditsnationalleaguefeaturesteamsinthef
irstdivisionandanotherfiveintheseconddivisionnottomentionatot
alfutsalteamsspreadacrossfourdifferentleaguedivisionsatfirstg
lanceitseasyforwesternstotendtothinkthatthisisacompletelydiff
erentculturebuthonestlyasanitalianwhatstruckmethemostwerethes
imilaritiessaidmoracepeoplearewarmandapproachableandtheresnop
lacewherethatisasclearasinfootballwhatisevidenttomeintehranis
agiganticpassionforfootballalevelofinterestthatstrulyoutstand
ingspecificallyamongthewomenthoughitsclearthatthispassioncarr
iesapotentialwhichisonlynowbeinguntappedhopefullythiscourseis
animportantsteptowardsthismahdiemohammadkhaniamemberoftheiran
ianfaswomenscommitteefullyagreeswiththeformeritalyandcanadaco
achwomensfootballhasflourishedinrecentyearsandnowadaysitsthem
ostpopularsportamongiranianwomenshesaiditsalsooneofthefavouri
tesportsformuslimwomenbecausetheyareallowedtoplaywhilewearing
aheadscarfmohammadkhanialsobelievesthatcombinationofdevelopme
ntcoursesandelitecompetitionslikenextyearsfifauwomensworldinj
ordanthefirstwomensworldcupheldinthemiddleeastarethewayforwar
dfortheregionitsagreatopportunitytoattractpublicopiniontowome
nsfootballandalsoforfemalemiddleeasternteamstoshowtheirstreng
thsagainstinternationalopponentssheconcluded
发现译文是有意义的,就把这个密文破解了。
如果发现译文是无意义的,就需要假设别的加密算法,根据假设的算法来使用相应的解密方法。
使用CPA4破解经典密码算法的更多相关文章
- Android逆向之旅---Android中锁屏密码算法解析以及破解方案
一.前言 最近玩王者荣耀,下载了一个辅助样本,结果被锁机了,当然破解它很简单,这个后面会详细分析这个样本,但是因为这个样本引发出的欲望就是解析Android中锁屏密码算法,然后用一种高效的方式制作锁机 ...
- 破解magento加密的密码算法
magento遇到丢掉密码的情况,其实很常见……比如我这记性,还好我比较暴力:-P 先看一段代码: /** * Hash a string * * @param s ...
- 【十大经典数据挖掘算法】PageRank
[十大经典数据挖掘算法]系列 C4.5 K-Means SVM Apriori EM PageRank AdaBoost kNN Naïve Bayes CART 我特地把PageRank作为[十大经 ...
- 5分钟破解wpa2密码(转)
首先大家要明白一种数学运算,它叫做哈希算法(hash),这是一种不可逆运算,你不能通过运算结果来求解出原来的未知数是多少,有时我们还需要不同的未知数通过该算法计算后得到的结果不能相同,即你不太可能找到 ...
- 密码算法详解——DES
0 DES简介 在20世纪60年代后期,IBM公司成立了一个由Horst Feistel负责的计算机密码学研究项目.1971年设计出密码算法LUCIFER后,该项目宣告结束.LUCIFER被卖给了伦敦 ...
- Mac系统安装Aircrack-ng破解wifi密码(2)
我们上一篇文章说过如何通过Aircrack-ng, 破解使用WPA/PSK加密方式的路由密码, 这一篇介绍的是使用Aircrack-ng破解使用WEP加密方式的路由密码: WEP和WPA/PSK的区别 ...
- Kali Linux使用Aircrack破解wifi密码(wpa/wpa2)
Kali Linux能做很多事,但是它主要以渗透测试及'破解wifi密码'闻名. 如果你使用Macbook 请看 使用macbook破解WPA/WPA2 wifi密码 要求: 安装有Kali Linu ...
- 路由器安全——破解wifi密码,同时中间人攻击
聊聊安全那些事儿 篇一:Wi-Fi安全浅析 2016-04-25 13:18:16 141点赞 712收藏 63评论 前言 近期,Wi-Fi相关的安全话题充斥着电视新闻的大屏幕,先是曝出了路由器劫持的 ...
- liboqs-量子安全密码算法开源C库
liboqs是一个用于量子安全密码算法的开源C库. 一,概述 liboqs提供: 量子安全 密钥封装机制(KEM)和数字签名算法的开源实现的集合: 这些算法的通用API: 测试工具和基准测试例程. l ...
随机推荐
- POJ-2442 Sequence K路归并问题
题目链接:http://poj.org/problem?id=2442 问题一:K个有序表合成一个有序表,元素共有n个.用堆优化 问题二:两个序列的前n小的元素.堆优化. 这题就是问题二的扩展,每次处 ...
- Codeforces149E - Martian Strings(KMP)
题目大意 给定一个字符串T,接下来有n个字符串,对于每个字符串S,判断是否存在T[a-b]+T[c-d]=S(1 ≤ a ≤ b < c ≤ d ≤ length(T)) 题解 对于每个字符串S ...
- POJ3356 – AGTC(区间DP&&编辑距离)
题目大意 给定字符串X和Y,可以对字符串进行一下三种操作: 1.删除一个字符 2.插入一个字符 3.替换一个字符 每个操作代价是1,问运用以上三种操作把X变为Y所需的最小步数是多少? 题解 定义dp[ ...
- Redis+Spring缓存实例(windows环境,附实例源码及详解)
原文出处: 小宝鸽 一.Redis了解 1.1.Redis介绍: redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串). ...
- storm的特性
storm的特性 Storm 是一个开源的分布式实时计算系统,可以简单.可靠地处理大量的数据流. Storm支持水平扩展,具有高容错性,保证每个消息都会得到处理,而且处理速度很快(在一个小集群中,每个 ...
- 利用ACE 自己实现的线程池
1: 线程池组件的配置文件: [log] ;DEBUG = 0 ;INFO = 1 ;WARN = 2 ;FAULT = 3 level=0 ;SCREENOUT = 0 ;FILEOUT = 1 ; ...
- Jquery常用方法篇(一)
1.add方法:将匹配的元素添加到当前的jquery对象集合中. 语法 add(expr,[context]) 参数1表示 用于匹配元素选择器(待添加的对象),或者用于动态生成的HTML代码(字符串) ...
- mongdb使用场景
你期望一个更高的写负载 默认情况下,对比事务安全,MongoDB更关注高的插入速度.如果你需要加载大量低价值的业务数据,那么MongoDB将很适合你的用例.但是必须避免在要求高事务安全的情景下使用Mo ...
- eclipse下修改项目名导致tomcat内发布名不一致的解决方法 .
eclipse下修改项目名导致tomcat内发布名不一致的解决方法 . ------------------------------------------------------- 解决方案: 直接 ...
- WPF非轮询方式更新数据库变化SqlDependency(数据库修改前台自动更新)
上一章节我们讲到wpf的柱状图组件,它包含了非轮询方式更新数据库变化SqlDependency的内容,但是没有详细解释,现在给大家一个比较简单的例子来说明这部分内容. 上一章节: WPF柱状图(支持数 ...