看起来随机的可逆数学函数 [英] Reversible math function that looks random

查看:108
本文介绍了看起来随机的可逆数学函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

  1. 通过某些函数x = g(y)是可逆的
  2. 序列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.

这篇关于看起来随机的可逆数学函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆