MarkdownPad Document

*:first-child {
margin-top: 0 !important;
}

body>*:last-child {
margin-bottom: 0 !important;
}

/* BLOCKS
=============================================================================*/

p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}

/* HEADERS
=============================================================================*/

h1, h2, h3, h4, h5, h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
font-size: inherit;
}

h1 {
font-size: 28px;
color: #000;
}

h2 {
font-size: 24px;
border-bottom: 1px solid #ccc;
color: #000;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777;
font-size: 14px;
}

body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
margin-top: 0;
padding-top: 0;
}

a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
margin-top: 0;
padding-top: 0;
}

h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
margin-top: 10px;
}

/* LINKS
=============================================================================*/

a {
color: #4183C4;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

/* LISTS
=============================================================================*/

ul, ol {
padding-left: 30px;
}

ul li > :first-child,
ol li > :first-child,
ul li ul:first-of-type,
ol li ol:first-of-type,
ul li ol:first-of-type,
ol li ul:first-of-type {
margin-top: 0px;
}

ul ul, ul ol, ol ol, ol ul {
margin-bottom: 0;
}

dl {
padding: 0;
}

dl dt {
font-size: 14px;
font-weight: bold;
font-style: italic;
padding: 0;
margin: 15px 0 5px;
}

dl dt:first-child {
padding: 0;
}

dl dt>:first-child {
margin-top: 0px;
}

dl dt>:last-child {
margin-bottom: 0px;
}

dl dd {
margin: 0 0 15px;
padding: 0 15px;
}

dl dd>:first-child {
margin-top: 0px;
}

dl dd>:last-child {
margin-bottom: 0px;
}

/* CODE
=============================================================================*/

pre, code, tt {
font-size: 12px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}

code, tt {
margin: 0 0px;
padding: 0px 0px;
white-space: nowrap;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}

pre>code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent;
}

pre {
background-color: #f8f8f8;
border: 1px solid #ccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px;
}

pre code, pre tt {
background-color: transparent;
border: none;
}

kbd {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #DDDDDD;
background-image: linear-gradient(#F1F1F1, #DDDDDD);
background-repeat: repeat-x;
border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;
border-image: none;
border-radius: 2px 2px 2px 2px;
border-style: solid;
border-width: 1px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 10px;
padding: 1px 4px;
}

/* QUOTES
=============================================================================*/

blockquote {
border-left: 4px solid #DDD;
padding: 0 15px;
color: #777;
}

blockquote>:first-child {
margin-top: 0px;
}

blockquote>:last-child {
margin-bottom: 0px;
}

/* HORIZONTAL RULES
=============================================================================*/

hr {
clear: both;
margin: 15px 0;
height: 0px;
overflow: hidden;
border: none;
background: transparent;
border-bottom: 4px solid #ddd;
padding: 0;
}

/* TABLES
=============================================================================*/

table th {
font-weight: bold;
}

table th, table td {
border: 1px solid #ccc;
padding: 6px 13px;
}

table tr {
border-top: 1px solid #ccc;
background-color: #fff;
}

table tr:nth-child(2n) {
background-color: #f8f8f8;
}

/* IMAGES
=============================================================================*/

img {
max-width: 100%
}
-->

那些年做过的ctf之加密篇(加强版)

大部分转自WooYun知识库,加入了笔者自己的理解

0x01 Base64

Base64: ZXZhbCgkX1BPU1RbcDRuOV96MV96aDNuOV9qMXVfU2gxX0oxM10pNTU2NJC3ODHHYWJIZ3P4ZWY=

Base64编码要求把3个8位字节(3*8=24)转化为4个6位的字节(4*6=24),之后在6位的前面补两个0,形成8位一个字节的形式。 如果剩下的字符不足3个字节,则用0填充,输出字符使用'=',因此编码后输出的文本末尾可能会出现1或2个'='

Base32: Base32和Base64相比只有一个区别就是,用32个字符表示256个ASC字符,也就是说5个ASC字符一组可以生成8个Base字符,反之亦然。

base64在线编解码:http://base64.xpcha.com/
base32在线解码(需翻墙):http://emn178.github.io/online-tools/base32_decode.html
或者使用python脚本解码:

 C:\Python27>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import base64
>>> str = 'haha'
>>> base64.b64encode(str)
'aGFoYQ=='
>>> base64.b64decode('aGFoYQ==')
'haha'

把脚本中的b64decode换为b32decode即可实现base32的解码

0x02 希尔密码

希尔密码:密文: 22,09,00,12,03,01,10,03,04,08,01,17 (明文:wjamdbkdeibr)
解题思路:使用的矩阵是 1 2 3 4 5 6 7 8 10

百度百科:http://baike.baidu.com/link?url=R6oWhCdKvzlG8hB4hdIdUT1cZPbFOCrpU6lJAkTtdiKodD7eRTbASpd_YVfi4LMl7N8yFyhVNOz5ki6TC7_5eq

暂没找到合适的在线解密网站或者好用的脚本,只能对具体问题求解;如有好用的工具,忘不啬指教!

0x03 栅栏密码

栅栏密码:把要加密的明文分成N个一组,然后把每组的第1个字连起来,形成一段无规律的话。

密文样例:tn c0afsiwal kes,hwit1r g,npt ttessfu}ua u hmqik e {m, n huiouosarwCniibecesnren.

解密程序:

 char s[]= "tn c0afsiwal kes,hwit1r  g,npt  ttessfu}ua u  hmqik e {m,  n huiouosarwCniibecesnren.";
char t[]= "";
int i,j,k;
k=;
for (i=;i<;i++)
{
for(j=;j<;j++)
{
t[k++]= ch[j*+i];
}
}
for(i=;i<;i++)
{
printf("%c",t[i]);
}

或者利用本篇末尾提供的密码机器

0x04 凯撒密码

凯撒密码:通过把字母移动一定的位数来实现加密和解密。明文中的所有字母都在字母表上向后(或向前)按照一个固定数目进行偏移后被替换成密文。
密文样例:U8Y]:8KdJHTXRI>XU#?!K_ecJH]kJGbRH7YJH7YSH]=93dVZ3^S8$:8"&:9U]RH;g=8Y!U92'=j$KH]ZSj&[S#!gU#*dK9.

解题思路:得知是凯撒加密之后,尝试进行127次轮转爆破:或者利用本篇末尾提供的密码机器;

lstr="""U8Y]:8KdJHTXRI>XU#?!K_ecJH]kJGbRH7YJH7YSH]=93dVZ3^S8$:8"&:9U]RH;g=8Y!U92'=j$KH]ZSj&[S#!gU#*dK9."""

解密脚本:

 for p in range(127):
str1 = ''
for i in lstr:
temp = chr((ord(i)+p)%127)
if 32<ord(temp)<127 :
str1 = str1 + temp
feel = 1
else:
feel = 0
break
if feel == 1:
print(str1)

0x05 Unicode

类似于ASCII码的一种编码方式:(详细资料http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html
密文样例:\u5927\u5bb6\u597d\uff0c\u6211\u662f\u0040\u65e0\u6240\u4e0d\u80fd\u7684\u9b42\u5927\u4eba\uff01\u8bdd\u8bf4\u5fae\u535a\u7c89\u4e1d\u8fc7\

在线解密:tool.chinaz.com/Tools/Unicode.aspx

0x06 brainfuck

请看我的另一篇关于Barinfuck与Ook!的博文http://www.cnblogs.com/WangAoBo/p/6373318.html

0x07 摩斯密码

就是影视剧中经常见到的那种密码
密文样例:-- --- .-. ... .

在线解密:http://www.jb51.net/tools/morse.htm
在线解密:http://www.zou114.com/mesm/

或者利用本篇末尾提供的密码机器

0x08 jsfuck

类似于brainfuck,也是一种替换密码,由( ) [ ] { } ! + 等符号组成

在线解密:http://utf-8.jp/public/jsfuck.html
在线解密:http://www.jsfuck.com/
在线解密:http://patriciopalladino.com/files/hieroglyphy/

或者直接再Chrome或者FIrefox的控制台中运行即可解码

0x09 培根密码

培根所用的密码是一种本质上用二进制数设计的。不过,他没有用通常的0和1来表示,而是采用a和b。

百科:http://baike.baidu.com/link?url=acaeI3babB7MogPQFh98rDAVSwHfPwh-HnEFTb9cx7DZ5Nz4MkMA14H4SDjBNnOdBsJpliNYa1vnfikQGqvA7K

0x0A 猪圈密码又称共济会密码

也是一种替换密码,替换方式如下:

或者可以表示成:

百度百科:http://baike.baidu.com/link?url=yN39kWG2pGd9XHo3RjeUAbd7xs0QlnJ2uHzCJfxC03V-fJcQUdfcJ-WuGoAkKGFVE0AxFK4-98wa4FtzvxRA0_

0x0B CRC32

密文样例:4D1FAE0B

 import zlib
def crc32(st):
crc = zlib.crc32(st)
if crc > 0:
return "%x" % (crc)
else:
return "%x" % (~crc ^ 0xffffffff)

本文持续更新,密码机器v1.0下载链接:http://pan.baidu.com/s/1hrIvpWS 密码:pdhx

那些年做过的ctf之加密篇(加强版)的更多相关文章

  1. [CTF]Rabbit加密

    [CTF]Rabbit加密 ---------------------  作者:adversity`  来源:CSDN  原文:https://blog.csdn.net/qq_40836553/ar ...

  2. Bugku CTF练习题---加密---ok

    Bugku CTF练习题---加密---ok flag:flag{ok-ctf-1234-admin} 解题步骤: 1.观察题目,发现规律 2.发现所有内容都是ook写的, 直接上网搜索一下原因,发现 ...

  3. Bugku CTF练习题---加密---聪明的小羊

    Bugku CTF练习题---加密---聪明的小羊 flag:KEY{sad23jjdsa2} 解题步骤: 1.观察题目,发现其中的信息 2.经过题目判断,得知该题属于栅栏密码的一种,并且介绍中表明了 ...

  4. Bugku CTF练习题---加密---凯撒部长的奖励

    Bugku CTF练习题---加密---凯撒部长的奖励 flag:SYC{here_Is_yOur_rEwArd_enjOy_It_Caesar_or_call_him_vIctOr_is_a_Exc ...

  5. 渗透测试思路 - CTF(番外篇)

    渗透测试思路 ​ Another:影子 (主要记录一下平时渗透的一些小流程和一些小经验) CTF(番外篇) ​ 笔者是一个WEB狗,更多的是做一些WEB类型题目,只能怪笔者太菜,哭~~ 前言 ​ 本篇 ...

  6. 腾讯QQ会员技术团队:人人都可以做深度学习应用:入门篇(下)

    四.经典入门demo:识别手写数字(MNIST) 常规的编程入门有"Hello world"程序,而深度学习的入门程序则是MNIST,一个识别28*28像素的图片中的手写数字的程序 ...

  7. linux初学者-磁盘加密篇

    linux初学者-磁盘加密篇 因为保密需要,一般系统中会在文件和磁盘中进行加密,但是文件的加密比较容易破解,不安全.所以在特殊需要下,会对磁盘进行加密,磁盘加密后在磁盘损坏的同时,其中的数据也会损坏, ...

  8. Bugku-CTF加密篇之+[]- (+++++ +++++ [->++ +++++ +++<] >++.+ +++++ .<+++ [->-- -<]>- -.+++ +++.< ++++[ ->.........)

    +[]- +++++ +++++ [->++ +++++ +++<] >++.+ +++++ .<+++ [->-- -<]>- -.+++ +++.< ...

  9. CTF常见加密方式汇总

    1.栅栏密码 在IDF训练营里做过一道关于栅栏密码的问题. 栅栏密码的解法很简单,也有点复杂,字符长度因数多得会有很多个密码.对,栅栏密码的解法就是:计算该字符串是否为合数,若为合数,则求出该合数除本 ...

随机推荐

  1. 码云项目克隆至github

    个人博客 地址:http://www.wenhaofan.com/article/20181104211917 因为我的博客项目一开始是存放在码云上面的,但是我又想在GitHub上有该项目的提交记录, ...

  2. python使用selenium驱动chromium防止浏览器自动升级失效!

    python爬虫或者自动化项目中有时会用到selenium自动化测试框架,驱动chrom时由于谷歌浏览器自动升级,会造成驱动和浏览器版本不匹配问题,这时可以用到Chromium,这是谷歌推出用于开发目 ...

  3. HDU1241 Oil Deposits(dfs+连通块问题)

    背景描述 ztw同志负责探测地下石油储藏.ztw现在在一块矩形区域探测石油.他通过专业设备,来分析每个小块中是否蕴藏石油.如果这些蕴藏石油的小方格相邻(横向相邻,纵向相邻,还有对角相邻),那么它们被认 ...

  4. 字符串匹配算法--暴力匹配(Brute-Force-Match)C语言实现

    一.前言 暴力匹配(Brute-Force-Match)是字符串匹配算法里最基础的算法,虽然效率比较低,但胜在方便理解,在小规模数据或对时间无严格要求的情况下可以考虑. 二.代码 #include & ...

  5. CF div2 E. Water Balance

    给你n个数,你可以这样操作:使区间[l,r]的数变成 他们的平均数,求字典序最小的序列. 做法:从左往右逐个比较,比较完之后会形成一个区间,一开始是区间为1的数进行比较,到后来会 变成区间较大的进行比 ...

  6. 2019牛客多校第七场 F Energy stones 树状数组+算贡献转化模拟

    Energy stones 题意 有n块石头,每块有初始能量E[i],每秒石头会增长能量L[i],石头的能量上限是C[i],现有m次时刻,每次会把[s[i],t[i]]的石头的能量吸干,问最后得到了多 ...

  7. TD - 多选框 - CheckBox

    模板 模板1:TD //Html - checked="true" 默认选中 <input dojoType="bootstrap.form.CheckBox&qu ...

  8. JVM的前世今生

    前世 jvm的数据区 分别是方法区(Method Area),Java栈(Java stack),本地方法栈(Native Method Stack),堆(Heap),程序计数器(Program Co ...

  9. python面试的100题(10)

    18.反转一个整数,例如-123 --> -321 class Solution(object): def reverse(self,x): if -10<x<10: return ...

  10. SQL中 select count(1) count中的1 到底是什么意思呢?和count(*)的区别

    count(1),其实就是计算一共有多少符合条件的行. 1并不是表示第一个字段,而是表示一个固定值.其实就可以想成表中有这么一个字段,这个字段就是固定值1,count(1),就是计算一共有多少个1.同 ...