当前位置: 首页 > news >正文

什么是随机数漏洞,什么是脆弱的随机数

电脑在没有用户参与的情况不能产生真正的随机数。

脆弱的随机数(随机数漏洞)只有在程序使用普通的方式产生随机数出现,主要有以下两种情况产生:
1,本来就不是随机数
2,这个产生的随机数是可以预测的,或可以通过某种途径预测到的

如果创造良好的随机数,电脑必须有达到两个条件:
1,一个良好的随机数生成算法
2,随机数生成算法有一个随机的和不可预测随机数种子

脆弱性随机数的例子

代码片断:

srand (time (0));
x=rand();

这个代码产生脆弱的随机号码,它使用的值为1作为默认种子。
其他任何人在相同的机器上用同样编译这段代码,将得到同样的随机数

随机数漏洞:
随机数生成器本地栈溢出

受影响系统:
Linux kernel < 2.6.22

不受影响系统:
Linux kernel 2.6.22

描述:
Linux Kernel是开放源码操作系统Linux所使用的内核。

Linux kernel的随机数生成器(RNG)实现中存在栈溢出漏洞,本地攻击者可能利用此漏洞提升自己的权限。

如果本地root用户将默认的wakeup阀值设置为比输出池大小还要大的值的话,池传输函数就可能用RNG字节写入栈,触发栈溢出,导致拒绝服务或权限提升。

厂商补丁:
Linux
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.3.tar.bz2

参考以下英文片段
——————————

What is a random number vulnerability?

Computers are deterministic and are therefore predictable. Computers cannot, in and of themselves, generate truly random numbers.

In the absense of outside input, computers can only create pseudo-random numbers.

A random number vulnerability occurs when a program uses a method of generating random numbers which is either:

  1. Not random
  2. Predictable

To generate good random numbers, the computer must have two things:

  1. A good random number generation algorithm
  2. A random and unpredicatable seed for the random number generation algorithm

Random Number Vulnerability Examples

Consider the following code snippet:

x=rand();

This code generated bad random numbers because when you call rand() before a seed has been established with srand(), it uses the value 1 as a default seed. Anyone else on the same machine with the same compiler who calls rand() with a seed of 1 will get the same random number as you just did.

Let’s look at another code snippet:

srand (time (0));
x=rand();

This code does call srand() with the current time as a seed. However, this code is still insecure because:

  1. The system time is a very bad seed, because it is predictable within a small range.
  2. The ANSI C rand() function itself does not generate good random numbers.

Let’s examine a third code snippet:

srandom (time (0));
x=random();

This code uses the BSD random() and srandom() functions, which generate much better random numbers than their ANSI C predecessors. However, this code still uses time() to generate the seed number. A much better source for random numbers on BSD and Linux systems is the /dev/random device.

Number Seeds and Random Number Vulnerabilities

Good seed numbers come from unpredictable events such as user keystrokes or mouse movements. These are not perfect sources of randomness, however. Human behavior is somewhat predictable and computer hardware can buffer keyboard and mouse interrupts, reducing their randomness.

Numerous other random number generators are available for various platforms and development environments. It is extremely difficult to create a good one, and even more difficult to determine if the random number generator you created really is generating random and unpredictable numbers. The best path for most applications is to implement an existing random number generator which has been subject to public cryptanalysis.

Random number vulnerabilities are of interest to hackers when they can be utilized to determine input values to cryptographic functions. This can be utilized in cryptanalysis.

Improper use of the function calls rand() and random() are the normal causes of random number vulnerabilities.

Additional Information Sources on Generating Random Numbers

For more information on generating random numbers, read RFC 1750 - Randomness Recommendations for Security.

百科地址:http://wiki.mygogou.com/doc-view-771.html

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 计算机联网工程学院,关于把计算机学院网络工程划到通信学院
  • 多用户的WordPress博客群搭建(WordPress Mu)
  • 计算机无法打开压缩包,电脑压缩文件为什么打不开?手把手教你解决压缩文件打不开的问题...
  • 几个对WEB开发有用的小工具
  • 计算机硬件维护实验报告,计算机硬件维护实验报告.doc
  • 2G内存刚刚好 浅谈4G内存对笔记本的影响
  • 计算机一级文件题后缀名改吗,计算机一级文件与文件夹操作题
  • 有钱的人总没有时间,有时间的人总没有钱
  • 计算机组成实验八,计算机组成原理实验八内存系统实验
  • 计算机机房环控模块箱的作用,机房环境监控系统的作用【斯必得智慧机房】
  • 最近因为公司的原因,一直没有办法在白天写文章,只有晚上能写一些
  • 进制转换计算机文档,计算机进制转换
  • Oracle JDBC 11gR1的一些特性
  • 两个网段计算机如何共享打印机,不同网段的打印机共享怎么连接?具体步骤
  • ODM例子报schema参数长度错误。
  • 自己简单写的 事件订阅机制
  • 0x05 Python数据分析,Anaconda八斩刀
  • Bytom交易说明(账户管理模式)
  • mysql_config not found
  • Object.assign方法不能实现深复制
  • Quartz初级教程
  • Rancher如何对接Ceph-RBD块存储
  • 百度小程序遇到的问题
  • 简单实现一个textarea自适应高度
  • 聊聊springcloud的EurekaClientAutoConfiguration
  • 猫头鹰的深夜翻译:JDK9 NotNullOrElse方法
  • 前端存储 - localStorage
  • 浅谈Kotlin实战篇之自定义View图片圆角简单应用(一)
  • 使用Gradle第一次构建Java程序
  • 项目实战-Api的解决方案
  • 智能合约Solidity教程-事件和日志(一)
  • nb
  • 3月27日云栖精选夜读 | 从 “城市大脑”实践,瞭望未来城市源起 ...
  • zabbix3.2监控linux磁盘IO
  • ​ ​Redis(五)主从复制:主从模式介绍、配置、拓扑(一主一从结构、一主多从结构、树形主从结构)、原理(复制过程、​​​​​​​数据同步psync)、总结
  • ​secrets --- 生成管理密码的安全随机数​
  • ​学习一下,什么是预包装食品?​
  • # Swust 12th acm 邀请赛# [ K ] 三角形判定 [题解]
  • #### golang中【堆】的使用及底层 ####
  • #我与Java虚拟机的故事#连载15:完整阅读的第一本技术书籍
  • $ is not function   和JQUERY 命名 冲突的解说 Jquer问题 (
  • (1)Nginx简介和安装教程
  • (delphi11最新学习资料) Object Pascal 学习笔记---第7章第3节(封装和窗体)
  • (Java企业 / 公司项目)点赞业务系统设计-批量查询点赞状态(二)
  • (Redis使用系列) Springboot 使用redis的List数据结构实现简单的排队功能场景 九
  • (二十四)Flask之flask-session组件
  • (黑马C++)L06 重载与继承
  • (七)理解angular中的module和injector,即依赖注入
  • .axf 转化 .bin文件 的方法
  • .NET DataGridView数据绑定说明
  • .NET I/O 学习笔记:对文件和目录进行解压缩操作
  • .secret勒索病毒数据恢复|金蝶、用友、管家婆、OA、速达、ERP等软件数据库恢复
  • [ C++ ] template 模板进阶 (特化,分离编译)
  • [20170705]diff比较执行结果的内容.txt
  • [2024] 十大免费电脑数据恢复软件——轻松恢复电脑上已删除文件