看起来随机的可逆数学函数

编程入门 行业动态 更新时间:2024-10-24 20:11:22
本文介绍了看起来随机的可逆数学函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想要一个数学函数y = f(x),其中x和y是32位整数,这样

I want a math function y = f(x) where x and y are 32 bit integers, such that

  • 通过某些函数x = g(y)是可逆的
  • 序列f(1),f(2),f(3),...看起来是随机的
  • 我曾考虑过使用某个常量密钥进行XOR,但这看起来似乎是随机的.我也可以使用DES或AES.但是这些似乎过分了.

    I thought about XOR with some constant key, but that fails to look random. Also I could use DES or AES. But those seem like overkill.

    有没有更简单的东西?

    推荐答案

    尝试使用分组密码,例如Skip32.但是请注意,这始终会将一个值加密为另一个值,因此您需要记住输入的重复会导致输出的重复,可能会将信息泄露给对手.

    Try a block cipher such as Skip32. But note that this does always encrypt one value to another value, so you need to remember that repetition of the input leads to repetition of the output, possibly leaking information to the adversary.

    否则,您可以查看保留格式的加密.有几种方法可以将分组密码的大小减半,例如3DES,它具有更高的安全裕度(如果使用三个随机密钥,则为112位),例如使用Feistel网络.

    Otherwise you can have a look at format preserving encryption. There are ways of halving the size of a block cipher such as 3DES, which has a significantly higher security margin (112 bits if you use three random keys), e.g. using a Feistel Network.

    草皮布丁密码"是一种奇怪的密码,它具有可配置的块大小.但是,该密码的安全性值得怀疑,并且至少没有进行足够的研究.

    A weird cipher is the Hasty Pudding Cipher, which has a configurable block size. However, the security of that cipher is questionable and not researched enough at the very minimum.

    更多推荐

    看起来随机的可逆数学函数

    本文发布于:2023-11-29 17:32:25,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1647102.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:函数   数学

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!