gpt4 book ai didi

c - 尝试加密和解密 code-beginner

转载 作者:太空宇宙 更新时间:2023-11-04 01:24:40 25 4
gpt4 key购买 nike

所以这是一个位操作练习,我对它们如何将字母转换为数字感到困惑,我认为这些不是二进制的,所以我不知道它们是什么意思。任何人都可以建议一种方法吗?

Here's two examples of encryption: "cats" and "kittens".

Pairs: "ca ts" "ki tt en s_" (_ represents a space) into ints: 25441 29811 27497 29812 25966 29472 XOR with 31337: 6408 3610 4352 3613 7943 2377

最佳答案

每对字母的十进制五元组只是 ASCII 中字符的十六进制值的十进制表示,例如:

"ca" = 0x63 0x61 = 0x6361 = 25441

XOR key 也是如此

31337 = 0x7A69

确实

0x6361 ^ 0x7A69 = 0x1908 = 6408 in decimal

关于c - 尝试加密和解密 code-beginner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33447548/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com