苹果电脑一直密码错误

There are a lot of myths and wrong assumptions about cryptography and security in general. It’s common for people to misuse cryptographic primitives, assume that something is secure by default or use outdated technology/algorithms. So, let’s look at some of those myths and common mistakes so that you can avoid them in the future.

通常,关于加密和安全性有很多神话和错误的假设。 人们通常会滥用密码原语,默认情况下会认为某些东西是安全的,或者使用过时的技术/算法。 因此,让我们看一下其中的一些神话和常见错误,以便将来避免它们。

停止使用/dev/random (Stop Using /dev/random Already)

Pretty much anybody would say that you should always use /dev/random for cryptographic purposes. Well, that's wrong. Both /dev/urandom and /dev/random are using the exact same CSPRNG. The difference between them is, that /dev/random blocks until it has enough entropy. Which is another issue - you don't want your applications to wait for entropy and design logic around possibility of /dev/random blocking, especially considering that you don't need that much entropy... All you need is about 256 bits of entropy, which you will get from /dev/urandom. If you want to delve deeper into this topic, then see article here.

几乎所有人都会说,出于加密目的,您应该始终使用/dev/random 。 好吧,那是错误的。 /dev/urandom/dev/random都使用完全相同的CSPRNG 。 它们之间的区别是/dev/random阻塞直到它具有足够的熵为止。 这是另一个问题-您不希望您的应用程序等待/dev/random阻塞可能性的熵和设计逻辑,特别是考虑到您不需要那么多的熵...您所需要的只是256位熵,您将从/dev/urandom 。 如果您想更深入地研究该主题,请参阅此处的文章。

永远不要使用AES ECB (Never Use AES ECB)

As you surely know AES is a block cipher. It encrypts plain text in blocks of 128 bits. Alright, sounds good, so what is the problem with using ECB (Electronic Code Book) mode? It uses an unaltered key on every block, so if you encrypt more than 128 bits of data, your ciphertext will look something like this:

如您所知, AES是分组密码。 它以128位为块加密纯文本。 好吧,听起来不错,那么使用ECB(电子密码簿)模式有什么问题? 它在每个块上使用未更改的密钥,因此,如果您对128位以上的数据进行加密,则密文将如下所示:

That’s not much of an encryption, right? So, what should you use instead of ECB? Counter mode (CTR)! Why? Because encryption can be done in parallel and it uses IV (nonce) to get rid of the unaltered key problem, that ECB mode has. Just remember to never reuse the IV.

那不是很多加密,对吗? 那么,您应该使用什么代替ECB ? 计数器模式(CTR)! 为什么? 因为加密可以并行完成,并且它使用IV (即刻)来消除ECB模式具有的不变密钥问题 。 只记得永远不要重复使用IV

This is how the cipher text would look with CTR mode:

这是在CTR模式下密文的外观:

You can try it yourself with openssl:

您可以使用 openssl 自己尝试

绝不将MD5用于任何用途 (Never Use MD5 For Anything, Ever)

While we are on the topic of never using stuff… Forget about MD5, like, right now. It was designed for use as a secure cryptographic hash algorithm, but there is nothing secure about it at this point. It has collision vulnerability, where you can create a pair of files that have the same MD5 hash, meaning that you can fake an SSL or CA certificate. So, what should you use instead? It depends on the use case — for password hashing use bcrypt or scrypt. Which one of those you use, is in my opinion personal preference - scrypt was designed to be "better" than bcrypt but it's newer so it faced less scrutiny. I - personally - still use bcrypt. As for the other use cases, use hash function from SHA-2 family, preferably longer digests like SHA-512.

当我们讨论从不使用任何东西的话题时……马上就忘掉MD5 。 它被设计为用作安全的密码哈希算法,但是目前还没有安全的方法。 它具有冲突漏洞,您可以在其中创建一对具有相同MD5哈希的文件,这意味着您可以伪造SSL或CA证书。 那么,您应该使用什么呢? 这取决于用例-对于密码哈希,请使用bcryptscrypt 。 在我看来,您使用哪一种是个人喜好scrypt设计要比bcrypt “更好” ,但是它较新,因此受到的审查较少。 我-个人-仍然使用bcrypt 。 至于其他用例,请使用SHA-2系列的哈希函数,最好使用较长的摘要(如SHA-512)

始终加密然后MAC (Always Encrypt-then-MAC)

The title of this section says “Encrypt-then-MAC”, but let’s backtrack a little bit first. A lot of people don’t realize that they should always use encryption in conjunction with message authentication. I don’t want to go into too much detail about why you should actually authenticate messages, all I’m gonna say is that if you don’t authenticate messages, then you are opening your applications to quite a few possible attacks, like replay attack or active attack.

本部分的标题为“ Encrypt-then-MAC” ,但让我们先回溯一下。 许多人没有意识到他们应该始终将加密与消息身份验证结合使用。 我不想过多地说明为什么您实际上应该对消息进行身份验证,我要说的是,如果您不对消息进行身份验证,那么您将使应用程序面临相当多的可能的攻击,例如重播攻击主动攻击

With that out of the way, why encrypt-then-MAC? Simply put, it’s the only way to get provable security, which isn’t always necessary, but it means that it’s essentially impossible to mess up cryptographically when using this construction.

有了这种方式,为什么要加密然后使用MAC ? 简而言之,这是获得可证明的安全性的唯一方法,但这并非总是必要的,但这意味着使用此结构时,基本上不可能以密码方式弄乱。

If you want a more in-depth explanation, then I recommend the article here by Colin Percival.

如果您想要更深入的解释,那么我建议您在这里发表Colin Percival的文章。

特殊字符不能使您的密码正确 (Special Characters Don’t Make Your Passwords Good)

Not necessarily, at least. A good password is one that you can remember, so throwing in characters like !@#$%^&* will make it more likely that you or users of your application will either forget it or write it down somewhere where someone else can see it.

不一定,至少。 好的密码是您可以记住的密码,因此,输入!@#$%^&*类的字符将使您或您的应用程序用户更有可能忘记该密码或将其写在其他人可以看到的地方。

What is the reason to add special characters to password in the first place? It’s entropy, so if we don’t want to force users to include special characters in their passwords, then what is the alternative to keep the entropy high enough?

首先在密码中添加特殊字符的原因是什么? 它是 ,所以如果我们不想强迫用户在密码中包含特殊字符,那么保持熵足够高的替代方法是什么?

Make it loooong. As shown in popular xkcd Password Strength comic, it makes more sense to use password made by concatenating a few random words, than trying to remember some gibberish. Creating these kinds of passwords satisfies both human and computer aspect of it, in other words, it’s easy to remember and reasonably hard to guess (high entropy, no way to brute force it).

放开它。 如流行的xkcd密码强度漫画中所示 ,使用通过连接几个随机单词而制成的密码比尝试记住一些乱码更有意义。 创建这些类型的密码既可以满足人类的要求,也可以满足计算机的要求,换句话说,它很容易记住,而且很难猜测(高熵,无法强行使用)。

Note: In an ideal world, everybody would use a password manager and generate their random super high entropy passwords, but that’s not something we can expect of the average, non-tech savvy user.

注意:在理想情况下,每个人都将使用密码管理器并生成随机的超高熵密码,但是对于普通的非技术型用户来说,这不是我们可以期望的。

加密密钥旋转误解 (Encryption Keys Rotation Misconception)

Somebody probably already told you, that you should rotate your keys at some time interval and that’s right, you absolutely should do that. A lot of people, though, think that they should do it to decrease the probability of key being broken, which is not the case for encryption keys. You should rotate encryption keys to reduce the amount of data encrypted by the key, to lower the potential damage caused by a single key being compromised. This misconception doesn’t change the fact that you should rotate keys, but it’s important to know why you are doing it so that you can correctly assess what intervals should be used.

可能有人已经告诉过您,您应该每隔一段时间旋转一次按键,没错,您绝对应该这样做。 但是,许多人认为应该这样做以降低密钥被破坏的可能性,而加密密钥却并非如此。 您应该旋转加密密钥,以减少通过密钥加密的数据量,以减少单个密钥被泄露所造成的潜在损害。 这种误解并没有改变您应该旋转键的事实,但是知道为什么要旋转键很重要,这样您才能正确评估应该使用的间隔。

从不存储用户密码 (Never Store User Passwords)

Back to the “never do stuff” topic once more. This one is a little bit of a rant, I’ve seen so many times, that a website sent me a password by email after I registered… like… first thing you should do when you get a password from a user is to hash it and throw away the clear text version of the password and if you are sending it to me by email, then you are clearly not doing that (end of rant)!

再次回到“永不做事”主题。 我已经看过很多次了,这很麻烦,以至于我注册后某个网站通过电子邮件向我发送了密码……就像……当从用户那里获得密码时,您应该做的第一件事就是对它进行哈希处理并丢弃密码的明文版本,如果您通过电子邮件将其发送给我,那么您显然没有这样做( rant结束 )!

So, let’s take a deep breath… how to store those passwords then?

因此,让我们深吸一口气……然后如何存储这些密码?

As soon as you receive the password from user — hash it with slow hash function like bcrypt using work factor of at least 12 and erase the clear text password from memory. The work factor of 12 is valid now, at the time of posting and will not be enough a year from now. I would personally shoot for up to 400ms for validation of password, you can check on your machine which work factor would give you.

收到用户的密码后,请使用工作系数至少为12的慢速散列函数(如bcrypt对其进行散列,并从内存中清除明文密码。 12的工作系数现在有效,在发布时有效,一年后还不够。 我会亲自拍摄长达400毫秒的密码验证,您可以在计算机上检查哪个工作因素会给您带来帮助。

If you’re not gonna use bcrypt make sure to add salt to password to prevent precomputation attacks like rainbow table attack.

如果您不打算使用bcrypt确保在密码中添加 ,以防止进行预计算攻击,例如彩虹表攻击

容器不安全 (Containers Aren’t Secure)

A lot of people think that Docker containers are secure by default, but that’s not the case. They were built to solve deployment problems, not security ones.

许多人认为Docker容器默认是安全的,但事实并非如此。 它们旨在解决部署问题,而不是安全问题。

There are even vulnerabilities that would allow an attacker to get root access to the host system and all that is needed is shell access to the container. So, how to avoid these security problems and vulnerabilities?

甚至存在一些漏洞,攻击者可以通过该漏洞获得对主机系统的root访问权限,而仅需要对容器的外壳访问即可。 那么,如何避免这些安全问题和漏洞呢?

  • Use minimal base images to reduce attack surface — Example of these images are alpine-based images or Red Hat universal base images.

    使用最小的基本映像来减少攻击面 -这些映像的示例是基于alpine的映像或Red Hat 通用基本映像

  • Install only necessary libraries — The less you have in the container, the lower is chance, that there will be something to exploit.

    仅安装必需的库 -容器中包含的资源越少,被利用的机会就越少。

  • Use trusted images — Don’t just download any image from Docker Hub. Use ones that are reviewed, maintained by trustworthy teams and have lots of downloads (lots of eyes on them).

    使用受信任的映像 —不要只是从Docker Hub下载任何映像。 使用由值得信赖的团队审查,维护并有大量下载内容的内容(很多关注对象)。

  • Don’t use latest tags - By using fixed tags you make sure that no vulnerabilities will get introduced with your next build.

    不要使用 latest 标签 -通过使用固定标签,您可以确保下一个版本不会引入任何漏洞。

  • Use the least privileged user (Never run under root) - It is a good practice to end your Dockerfiles with USER 1001 command to make sure that you use a user with no privileges that could open your container to extra vulnerabilities.

    使用特权最小的用户(永远不要在 root 下运行 ) -一个好的做法是使用USER 1001命令结束Dockerfiles ,以确保您使用的用户没有特权,这会使您的容器遭受更多漏洞。

There are many more things that you could do to secure your images, which you can google later, but I think the list above is the bare minimum that everybody should have in mind when using Docker images/containers.

您还可以做很多事情来保护图像,以后可以在Google上进行搜索,但是我认为上面的列表是使用Docker图像/容器时每个人都应该记住的最低要求。

结论 (Conclusion)

Every software developer/DevOps engineer is responsible for the security of applications and system, at least to some extent (whether you like it or not). Therefore, I believe that all of us should take a little bit of time to do the necessary research to make sure to avoid stupid mistakes and misconceptions like the ones above.

每个软件开发人员/ DevOps工程师都至少在一定程度上(无论您是否喜欢)对应用程序和系统的安全性负责。 因此,我相信我们所有人都应该花一点时间来进行必要的研究,以确保避免上述愚蠢的错误和误解。

Don’t just trust what people tell you (people make mistakes all the time). When it comes to security and cryptography look things up and check it yourself — make decisions based on facts.

不要仅仅相信人们会告诉你的内容(人们总是会犯错误)。 当涉及到安全性和加密技术时,请自行检查并进行检查-根据事实做出决策。

Note: This was originally posted at martinheinz.dev

注意:这最初发布在 martinheinz.dev

翻译自: https://towardsdatascience.com/security-and-cryptography-mistakes-you-are-probably-doing-all-the-time-7407c332944f

苹果电脑一直密码错误


http://www.taodudu.cc/news/show-2443123.html

相关文章:

  • HTML,js,jQuery的1+S证书学习资料
  • 触碰密码世界的大门
  • 百度1+x计算机视觉证书题库
  • 网站密码加密原理
  • 信息安全 - 密码学 (中法)
  • ssl证书 嵌入式设备_ngx_http_ssl_module
  • 公钥密码学 公钥基础设施_简单解释公钥密码学
  • aws ssh 证书配置_在AWS Lambda中运行netflix bless ssh证书颁发机构
  • 信息安全与密码学概论
  • 密码编码学与网络安全
  • 《图解密码技术》笔记
  • 先旋转x在旋转y 在旋转z_旋转Kubernetes中的秘密
  • 【学习笔记】密码学入门(3) 密钥,随机数,PGP软件
  • 旋转Kubernetes中的秘密
  • PKI密码学学习笔记
  • 图解密码技术
  • 凯撒密码加密算法python_信息安全与密码学的关系
  • python三维图旋转_3D图像旋转简单的ITK Python(3D Image Rotation Simple ITK Python)
  • 密码学浅析
  • SameSite Cookie支持的浏览器版本
  • csrf 与 samesite
  • php 解决Chrome Cookie 的 SameSite 属性导致无法写入cookie问题
  • std::is_same的用法
  • 浏览器CookieSameSite
  • Chrome 80 Cookie跨域 Samesite Lax 的错误
  • 浏览器默认设置SameSite属性的作用
  • 同源、跨域、跨站、SameSite与withCredentials
  • chrome 同站策略(samesite)问题及解决方案
  • Chrome 配置samesite=none方式
  • C++11的std::is_same和std::decay使用与源码解析

苹果电脑一直密码错误_您可能一直都在犯的安全和密码错误相关推荐

  1. 能够切换用户重新登录计算机,苹果电脑切换用户登录_苹果电脑切换登录账号...

    2016-12-16 16:28:17 默认的输入法切换快捷键是command+Space空格键,少数情况下这个快捷键会变成启动Spotlight,这时试一下shift+command+Space应该 ...

  2. 苹果台式机怎么设置我的电脑计算机,苹果电脑一体机怎么开机_苹果台式一体机开机在哪-win7之家...

    很多用户都喜欢使用一体机电脑,而苹果电脑则是很多小伙伴青睐的品牌,不过对于一些初次接触苹果电脑一体机的用户们来说,可能连开机都不知道要怎么操作,想必很多用户都不清楚苹果台式一体机开机在哪吧,其实方法很 ...

  3. 苹果电脑mac截屏_谁说 mac系统 不适合搞科研? | 假期不宜出门,宜学习!

    搞科研的朋友们每天都离不开电脑!于是,科研界又分为 Windows 派和 Mac 派.要想提高生产力,本人还是想大吼一声:Mac 大法好! 看着师弟师妹对着苹果电脑咬牙切齿,恨不得分分钟砸了它:殊不知 ...

  4. 苹果电脑 没有可用镜像_苹果电脑安装双系统教程 Mac OS+Windows 10(bootcamp手动完成)...

    开始之前我们首先要确定哪些型号的苹果电脑可以安装Windows 10 MacBook Pro (2012 年中或以后) MacBook Air (2012 年中或以后) iMac (2012 年末或以 ...

  5. sql 避免除0错误_设计简历时避免这3个常见的UX错误

    sql 避免除0错误 重点 (Top highlight) Having a great looking resume on hand is very important when you're lo ...

  6. 请在请求中携带deviceid参数_日常工作中最容易犯的几个并发错误,你中了几个?...

    作者:Jay_huaxiao 前言 列举大家平时在工作中最容易犯的几个并发错误,都是在实际项目代码中看到的鲜活例子,希望对大家有帮助. First Blood 线上总是出现:ERROR 1062 (2 ...

  7. smart 200密码忘记_如何阻止某些Android应用与Smart Lock同步密码

    smart 200密码忘记 Google's Smart Lock for Passwords makes it easy to sync the passwords you have saved i ...

  8. 登录共享计算机的用户名和密码,如何设置访问共享时每次都需要输入帐号和密码?...

    访问共享时,如何设置每次都需要输入帐号和密码呢,这里小编以WIN7系统做演示,XP系统类似操作. 1.首先在开始菜单中找到"附件"下的"运行",点击打开,如图所 ...

  9. mac mysql密码错误_解决mac 下mysql安装后root用户登录密码错误问题

    使用的mac OS 10.11  安装mysql后访问root/root用户失败,网上找了一些解决办法,下面记录下解决方法方便以后自己查询 概述(看懂下面就不用看了): 停服务:sudo /usr/l ...

  10. 苹果电脑如何删除软件_软件开发公司误将委托人系统数据删除,责任如何认定?...

    杭州臣工环保科技有限公司(以下简称臣工公司)本是一家专业从事新风净化智能硬件设备研发.生产与销售的企业.因业务发展需要,臣工公司与广州机智云物联网科技有限公司(以下简称机智云公司)于2017年6月29 ...

最新文章

  1. springmvc获取request对象
  2. 《高性能javascript》读书笔记
  3. [luoguP1168]中位数(主席树+离散化)
  4. 从 Android 静音看正确的查找 bug 的姿势
  5. java.lang.IllegalStateException: 启动子级时出错
  6. IDEA中SpringBoot中使用单元测试Junit方法
  7. android studio真机模拟不能拍照_android和ios静态库的生成
  8. C语言荣获2019年度最佳编程语言
  9. 【Level 08】U07 Mixed Feelings L1 Day trip
  10. activiti高亮显示图片_Excel全自动甘特图,工作进度显示,极简设计快手套用
  11. [Ubuntu] fg、bg让你的进程在前后台之间切换
  12. PS经典教程:从零开始设计一个漂亮的网页
  13. 本月热门技术岗位招聘,全在这里了!
  14. 怎样修改传奇世界服务器,传奇世界服务器如何设置怪物攻击手段详细攻略
  15. 是否需要这么一支“特别行动队”?
  16. MySQL连接查询的成本
  17. 制作 Google Chrome 绿色版
  18. 理解promise、promise.all、promise.race
  19. 交流下垂控制_单机验证仿真
  20. mybatis逆向工程的使用,自动生成实体类与基础SQL

热门文章

  1. 计算机算样本标准偏差,计算器中的总体标准差和样本标准差有什么区别
  2. python词组语义相似度_语义相似度
  3. yapi接口管理工具
  4. 实验室信息管理系统LIMS的25个典型模块
  5. Excel各种条件求和的公式汇总
  6. 微信公众号内置浏览器缓存清理
  7. 对比阿里云服务器和腾讯云服务器两者的不同之处
  8. 输入年份月份判断是平年还是闰年及这个月有多少天
  9. VMware Workstation 安装及配置HMC V8R860
  10. win10显示WiFi已连接但无法访问互联网?