- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
https://www.tools4noobs.com/online_tools/encrypt/ 给出“a67a318c98a0307502ba81caade2f3a9”作为 key “1234567890abcdef”和有效负载“encrypt this”的 DES ECB 结果。
PHP代码
echo bin2hex(mcrypt_encrypt(
MCRYPT_DES,
hex2bin("1234567890abcdef"),
"encrypt this",
MCRYPT_MODE_ECB)) . "\n";
打印出“1a29ee87f2ad67644ff28450c676a664”。
代码有什么问题?
最佳答案
noobs4tools 网站删除了 hex2bin
函数并将 key 长度截断为 8 个字符(如 Yoshi 在评论中所述)。
对于 12345678
的 key 大小,网站和 PHP 代码的输出是一致的。
DES key 大小在手册中规定为 56 位。请阅读以下有关 DES 特定 key 大小的一些有用背景。
How should I create my DES key? Why is an 7-character string not enough?
noobs4tools 网站使用的 key :
"12345678"
您的代码使用的 key :
hex2bin("1234567890abcdef"); // 4Vx����
这种差异会给您带来不同的输出。
因此该网站不会将 key 转换为任何其他数字或数据形式。它希望您在页面脚本中提供格式正确的值。
关于php - 使用 PHP 的 DES ECB 加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40015660/
我们使用下面的密码 AES/ECB/NOPADDING 但我有点困惑,因为像 ECB 这样的模式需要根据 block 大小填充输入。但是这里我们说 NOPADDING。他们看起来不矛盾吗。 我们能否将
据我所知,两者是相同的,但一个在一台 PC 上工作,而相同的代码说: javax.crypto.NoSuchPaddingException:OAEPWITHSHA-256ANDMGF1PADDING
我想在Java中用rsa/ecb/pkcs1填充模式用给定的公钥(公钥是一个字符串)来编码一个字符串。。我也想用UTF-8格式呈现成绩,怎么办呢?
使用 Emacs 24.3.1 附带的 CEDET 和 Melpa 中的 ECB,我得到以下尝试 ecb-activate : All requirements for ECB 2.40 fulfil
使用 Emacs 24.3.1 和 ECB 2.40 运行 Ubuntu 12.10。除了几天前我运行的 apt-get update && upgrade 之外,不确定究竟是什么导致了这种情况。 它
所以我确实安装了 Emacs 24.3.1,并且从 24 开始它带有 CEDET。我通过 list-packages 安装了 ECB,一切似乎都有效——除了方法窗口刷新。 当我打开一个文件时,会显示所
是否可以制作 emacs ecb(Emacs 代码浏览器)在目录浏览器中不显示 .pyc 和 .pyo 文件? 最佳答案 您可以自定义变量 source-file-regexps 来指定哪些文件显示为
我正在尝试使用带有硬编码 key 的 DES/ECB/PKCS5Padding 算法在 Java 中加密相同的数据。我使用 online tool 验证了我的加密值。如果我使用带有特殊字符的 key
我的 php 脚本和我的 c# 应用程序将相互传递一个 32 个字符长的哈希字符串,最好的模式是什么?我认为是欧洲央行,但我不确定是否使用超过 1 个区 block 就不要使用。我怎么知道 block
我正在使用 ECB (Emacs Code Browser)和我的默认布局如下: ;; +------+-------+--------------------------------------+
在 emacs 中,ecb 作为次要模式运行,我想将布局设置为默认。因此,一旦 emacs 启动,我就拖动左侧的 Pane 来更改布局,当我在“布局管理”下说“存储当前窗口大小”时,它会正确写入文件
我正在尝试检索设备注册 ID,以便从我的后端向其发送通知。 我已经尝试过几次: 在我的对象之外 GambifyApp.NotificationManager = window.GambifyApp.N
我最近编写了一个简单的 java 应用程序,尝试使用 ECB CBC 加密模式,并且我注意到我的代码工作方式有些奇怪。由于某种原因,我生成的密文将始终产生相同的字符串,并且我注意到 ECB 和 CBC
从this Wikipedia article on cipher modes来看以及我听说过的有关 ECB 的其他事情,这是一个很大的禁忌,可能会泄露有关您的加密数据的信息。然而,网上仍有大量使用
public class Symmetric1 { /** * @param args the command line arguments */ public s
我在使用 openssl crate 解密字节字符串时遇到问题。请注意,这是针对 Cryptopals 挑战,特别是第 2 组问题 2。文本文件已使用 AES 和 CBC 模式加密,但我猜单个 blo
我已经搜索了很多关于我的任务,比如, 我正在通过使用 RSA/ECB/PKCS1Padding 从后端加密的 XML 获取数据,他们给了我一个文件名 “publickey.der”。根据他们的说法,这
我想在java中使用给定的公钥(公钥是一个字符串)以rsa/ecb/pkcs1填充模式对字符串进行编码。 我还想以 UTF-8 格式呈现结果怎么办? 最佳答案 我已经完成了这段代码:
我正在尝试使用带有 RSA key 对的 Cipher 以及 "AndroidKeyStore"。在我能找到的所有 Android 文档中,示例显示 Cipher.getInstance("RSA/E
我正在尝试执行已知文本攻击以获得 32 字节 key 。BlockSize 为 16 字节。 关于此:https://crypto.stackexchange.com/a/12512 或者这个:htt
我是一名优秀的程序员,十分优秀!