- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
来自:加密公司
收件人:x$*sj4(就是你)
如果您选择接受的话,您的任务是用最短的击键次数创建一个程序,
采用两个文件名参数(命令行或标准输入),第一个是包含 key 的文件,第二个是一些消息。这两个文件都是纯文本。
使用 XOR encryption 将 key 应用于消息,覆盖文件。
示例:
输入文件:
StackOverflow is Cool
关键:
Code Golf
加密输出文件的十六进制转储:
0000000: 101b 0506 4b08 1909 1425 030b 1200 2e1c ....K....%......
0000010: 4c25 2c00 080d 0a L%,....
为简单起见,假设文件可以放入内存
<小时/>此消息将在 5... 4... 3... 2... 1... 内进行自加密
#####
#### _\_ ________
##=-[.].]| \ \
#( _\ | |------|
# __| | ||||||||
\ _/ | ||||||||
.--'--'-. | | ____ |
/ __ `|__|[o__o]|
_(____nm_______ /____\____
<小时/>
如果 key 的大小大于或等于消息的大小并且 key 是由无偏随机过程生成的,则异或加密是不可能破解的。请参阅:One-time pad 。所以这里没有“糟糕的加密”。
最佳答案
Repent 是我自己的一种深奥的基于堆栈的玩具语言,其灵感来自 J、APL、Golfscript 和 Python。这是一个简短的解决方案。我会解释它,但是已经很晚了,这让我很头疼,所以我会解释它并在早上发布一个 Silverlight 解释器。
↓↷¦*⊕;€
说明:
↓ Copies the message string back onto the stack
↷ Puts the extra message string to the bottom of stack
¦ Find length of message string
* Multiply key array by last number - repeats key for at least as long as message
⊕; Apply XOR between each element corresponding of message array and repeated
key array, pushing XOR encoded message to stack
€ Print encoded message string/(char array) as string.
使用如下:
Repent "↓↷¦*⊕;€" "Code Golf" "StackOverflow is Cool" > output.txt
输出(大多数字符不显示):
Ascii: K % .L%,
Hex: 10 1B 05 06 4B 08 19 09 14 25 03 0B 12 00 2E 1C 4C 25 2C 00 08 0D 0A
<小时/>
使用文件是:
↓↶▲⇄▲↓3↔⇄¦*⊕;▼
<小时/>
关于encryption - Code Golf : XOR Encryption,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3478954/
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 8 年前。 Improve this ques
我heard “PKCS#1 v2.0 加密通常称为 OAEP 加密”。 在我的项目中使用它之前,我需要某种“官方”文档来说明这一点。我试图找到它但没有成功。知道在哪里可以找到吗? 谢谢! (顺便说一
已锁定。这个问题及其答案是locked因为这个问题是题外话,但却具有历史意义。目前不接受新的答案或互动。 来自:加密公司 收件人:x$*sj4(就是你) 如果您选择接受的话,您的任务是用最短的击键次数
我正在使用带有 docker/docker compose 和 traefik 的 ubuntu 18.04.1 LTS。使用暂存 Let's Encrypt caserver ( https://a
我目前正在完成一篇关于通过各种密码算法加密数据的论文。 我花了很多时间阅读期刊和论文,但还没有找到任何关于它们的性能复杂性的记录。 有人知道以下算法的 Big-O 复杂度吗? RSA DES 三重 D
我正在为嵌入式系统(微 Controller )编写固件。固件可以通过引导加载程序(也是我编写的)进行更新。 现在需要采取措施防止固件被操纵,因此系统必须仅执行具有某种有效签名的下载固件。 固件文件已
我试图了解加密(“受密码保护”)Office 2007 文档(特别是 Excel 文档)的捆绑方式。我正在试验一个已知的、受密码保护的电子表格。 当我解压 XLSX 文件时,我遇到了三个条目: [6]
K8s对encrypt secret data具有此功能,这需要修改kube-apiserver配置,我如何在GKE中做到这一点? 最佳答案 简短的答案是,你不能。 Kubernetes Engine
我正在使用 ENCRYPT() 函数在 mysql 中存储一个字符串。我想获取匹配该字符串的行,但新的 ENCRYPT() 调用给了我一个不同的值,因此它们永远不会匹配。 这是预期的,因为我没有(也不
在带有 Python 2.7 和 GPG4Win v2.2.0 的 Windows 7 上使用 python-gnupg v0.3.5 test_gnupg.py 导致 2 次失败: Test tha
我尝试兼容 C# 和 Java 的加密/解密。 据我所知,默认模式在 Java 中是“ecb/pkcs5”,在 C# 中是“cbc/pkcs7”。 所以我匹配这些东西。 第一个问题是 PKCS7 和
我使用 SwiftyRSA 使用带有 PKCS1 填充的公钥加密字符串。不幸的是,当我用 Java 解密我的加密字符串时,我发现了 BadPadding: Encryption Error。到目前
比特币是一种匿名的加密数字货币。几个月前我有了加密文件的想法,其中需要比特币的支出证明才能解密文件。当比特币被发送到给定地址时,它会显示在分布在对等网络中的块文件中。区块链的完整性是通过需要大量计算机
我有一个类,我试图用依赖注入(inject)替换 Crypt::encrypt 的外观用法: encrypter= $encrypter; }
我想使用带有 RSA 算法的 OpenSSL 使用私钥加密文件: openssl rsautl -in txt.txt -out txt2.txt -inkey private.pem -encryp
我在 TCL 中使用 DES 来加密一些短语,我想将这些加密的短语存储在一些我需要轻松操作的 ascii 文件中。因此,我希望“加密短语”仅由标准 ascii 字符构成(最好没有空格)。 我正在使用类
我在 TCL 中使用 DES 来加密一些短语,我想将这些加密的短语存储在一些我需要轻松操作的 ascii 文件中。因此,我希望“加密短语”仅由标准 ascii 字符构成(最好没有空格)。 我正在使用类
我对Android平台不同的数据存储加密机制有点困惑。据我了解: 全盘加密影响整个/data 磁盘并且只能是由用户激活/停用。 ( https://source.android.com/securit
我正在使用 Lumberjack 作为日志记录平台(Objective C/Swift)有没有办法将日志加密写入文件? 如果是,那么任何例子都是有用的 另外,之后如何读取加密后的日志 密集型日志记录是
我确定这是一个典型的场景,但我找不到合适的步骤顺序。 我有一个运行 Apache 的 www.example.com 服务器(比如)1.1.1.1。我正在使用 Caddy 在 2.2.2.2 上构建一
我是一名优秀的程序员,十分优秀!