PHP成为首个在内核中嵌入加密库的编程语言
PHP团队最近投票一致通过了“将Libsodium库集成到PHP内核中”的决议,使得PHP成为首个使用公认现代加密库的编程语言。
Libsodium是个便捷,可交叉编译,现代化,易于使用的软件库;可用于加密,解密,签名,密码哈希等。和PHP源代码一样,Libsodium是用C编写的。如今,很多公司,如Keybase,数字海洋,Riseup,Yandex,Wire和Zcash,已经他们的服务中部署Libsodium。
提出加入Libsodium建议的的开发者是来自Paragon Initiative公司的首席开发官Scott Arciszewski,他曾在过去的开发会议中提倡在PHP CMS中加入更强大的加密技术。
Libsodium将在PHP 7.2中出现
PHP团队决定在2017年年底推出的PHP 7.2中加入Libsodium。目前最新PHP版本为7.1.2。
Arciszewski解释了他为什么期望在PHP内核中嵌入Libsodium,主要原因就在于WordPress以及共享托管供应商——绝大部分共享主机供应商不允许用户安装自定义PHP扩展,因为许多未经测试或未知的扩展可能对其设备造成危害。
Arciszewski的想法是如果将Libsodium集成到PHP内核中,就可以摆脱对托管提供商的依赖,用户也不用再为PHP扩展的安全性担忧,因为以后的PHP版本将会默认支持加密库。“共享主机提供商还是主要原因,因为VPS供应商(在我印象中,总是)一般是让你在自己虚拟机上以root权限运行的。”
除此之外,Arciszewski表示Libsodium的加入,同样也免去了说服WordPress团队去加强他们的安全建设的过程,因为他们自然会用PHP默认支持的强加密功能。
PHP需要Libsodium的其他原因
相关PHP加入Libsodium,Arciszewski还提出了更多原因,他认为Libsodium嵌入到PHP核心对PHP全局的安全性有很多好处。比如说:
1.显然Libsodium会让共享网络托管提供商为用户升级到PHP 7.2;
2.本次升级会告诉操作系统开发人员,“Libsodium是必要的;它是默认安装的一部分”;
3.PHP手册将会列出对libsodium扩展的说明,这意味着开发人员将有官方文档可依;
4.PHP 7.2+内部就能使用libsodium功能,例如PHP Archives(Phar扩展)很快就会有Ed25519签名;
5.在不对用户产生影响的情况下,那些需要libsodium的开源项目就可方便安装。
Arciszewski在邮件中提到:“我坚信安全应该属于每个人,而不应该只属于那些有能力为安全买单的1%的人。PHP在互联网上的占有率至少有82%,而libsodium又是大多数加密技术人员推荐的应用层加密库。
“在PHP开发者眼中,PHP和libsodium的联手应该是获得更好的安全性最为直接和合理的方式。许多开发者没有时间或加密方面的经验来搭建属于自己安全。”
为什么“第一个”是PHP,而不是Go或Erlang?
Arciszewski解释了使用加密库后的技术优势,以及为什么Libsodium是现在最现代化的加密库之一,详情点击这里可查看。另外他还解释了为什么PHP才是真正意义上“第一个”在其核心中支持“现代”加密库的编程语言——尽管Erlang和Go包含类似的库,但是它们的实施完整性与将来加入到PHP 7.2中的Libsodium不可同日而语。
在加入Libsodium到PHP之前,Arciszewski已经在WordPress之上进行了实践,他在WordPress 4.4中添加了一个强大的CSPRNG(加密安全伪随机数生成器),并发现WordPress更新过程中的几个缺陷,这将允许攻击者劫持互联网上的所有WordPress网站。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.
