TEA在 Tea 算法中其最主要的识别特征就是 拥有一个 magic number :0x9e3779b9 。当然,这 Tea 算法也有魔改的,感兴趣的可以看 2018 0ctf Quals milk-tea。TEA算法的特征是delta值和16字节的密钥(128位)以及32轮迭代这些东西可以魔改,如果没魔改过,插件可以识别出该算法,否则需要算法结构手动找x-=0x61c88647和x+=0x9e3779b9,这两个值是等价的1.算法原理在密码学中,微型加密算法(Tiny Encryption Algorithm,TEA)是一种易于描述和执行的块密码,通常只需要很少的代码就可实现。其设计者是剑桥大学计算机实验室的大卫 · 惠勒与罗杰 · 尼达姆。在安全学领域,TEA(Tiny Encryption Algorithm)是一种分组加密算法,它的实现非常简单,通常只需要很精短的几行代码。TEA算法使用64位的明文分组和128位的密钥,它使用Feistel分组加密框架,需要进行64轮迭代,但是作者认为32轮已经足够了,所以32轮迭代加密后最后得到的密文就是64位。简单的说就是,TEA加密解
一、原理以下算法分析基于 RFC 3174。Request For Comments (RFC),所有关于Internet 的正式标准都是以RFC(Request for Comment )文档出版。需要注意的是,还有大量的RFC文档都不是正式的标准,出版目的都是为了提供信息。由互联网协会(Internet Society,简称ISOC)赞助发行,会交到互联网工程工作小组(IETF)和互联网结构委员会(IAB)。文档可由网站 https://www.ietf.org/ 下载。SHA1原理全称为 Secure Hash Algorithm 1(安全散列算法1)。是一种密码散列函数,美国国家安全局设计,并由美国国家标准技术研究所(NIST)发布为联邦数据处理标准(FIPS)。1993年 发布 SHA0,1995年发布了SHA1。其设计原理相似于MIT教授 Ronald L. Rivest 所设计的密码学散列算法 MD4 和 MD5。SHA1 可以生成一个被称为消息摘要的160位(20字节)散列值,散列值通常的呈现形式为40个十六进制数。主要适用于数字签名标准 (Digital Signat
一、简单加解密原理(1)加密图中的E是公钥(E和 φ(N)互为质数),N是公共模数(质数 P 、Q相乘得到N),MOD就是模运算(2)解密图中的D是私钥(私钥由这个公式计算得出E * D % φ(N) = 1),N是公共模数(质数 P 、Q相乘得到N),MOD就是模运算,φ(N)是欧拉函数(由这个公式计算得出φ(N) = (P-1)(Q-1))。二、例题及解题脚本--RE49-signin此题中:密文:ad939ff59f6e70bcbfad406f2494993757eee98b91bc244184a377520d06fc35大整数N:103461035900816914121390101299049044413950405173712170434161686539878160984549公钥E:655371.先通过N算出P和Q:方法一、通过大素数分解网站http://factordb.com/index.php方法二、用离线暴力破解工具yafu(使用教程见工具目录下README)进入文件目录后打开cmd,输入yafu-x64 factor(),括号内填要分解的大素数得到P=282
一、RC4算法简介在密码学中,RC4(来自 Rivest Cipher 4 的缩写)是一种流加密算法,密钥长度可变。它加解密使用相同的密钥,因此也属于对称加密算法。RC4 是有线等效加密(WEP)中采用的加密算法,也曾经是 TLS 可采用的算法之一。 RC4算法由Ron rivest于1987年设计出的一种对称加密算法,其加密密钥和解密密钥是相同的,加密和解密过程也相同。 属于对称加密算法中的流密码加密算法,流密码不对明文数据进行分组,而是用密钥生成与明文一样长短的密码流对明文进行加密。密钥长度可变,面向字节操作,是以一个足够大的表s为基础,对表进行非线性变换,产生密钥流。加密:原文和Keystream进行异或得到密文解密:密文和Keystream进行异或得到原文二、加密过程Pasted image 20231212141652.png1.密钥调度算法KSA(Key Scheduling Algorithm)(初始化)(1)对S表进行线性填充(一般为256字节,用来作为密钥流生成的种子1)Pasted image 20231212141704.png(2)用种子密钥(就是我们的秘钥
一、原理及每步实现见文章:https://juejin.cn/post/7084242293816983589?searchId=20240321135336F4E57A424C6F2E776B59二、代码(1)来源此文章的最完整代码:# __author: Junebao # data:2020/3/9 from bitarray import bitarray class MyDES: def __init__(self): self.child_keys = [] @staticmethod def _bit_encode(s: str) -> str: """ 将字符串转换为01字符串的形式 """ return bitarray( ''.join([bin(int('1' + hex(c)[2:], 16))[3:]
Norman1z