mvn --encrypt-master-password< password>如何工作? [英] How does mvn --encrypt-master-password <password> work?

查看:241
本文介绍了mvn --encrypt-master-password< password>如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道此命令使用的算法或技术(mvn --encrypt-master-password).每次我运行它都会产生不同的输出.我假设它将系统时间作为种子参数.

I would like to know the algorithm or technique used by this command (mvn --encrypt-master-password ). Each time I run it produces a different output. I'm assuming that it takes system time as a seed parameter.

推荐答案

加密机制本身不在maven代码库中.它位于名为plexus-cipher的库中.它总是在Maven发行版上.我的在lib/plexus-cipher-1.7.jar上,是3.0.5的Maven版本.

The encryption mechanism is not in the maven codebase per se. It is located on a library called plexus-cipher. It is always on the maven distribution. Mine is on lib/plexus-cipher-1.7.jar being 3.0.5 the maven version.

实际密码为AES/CBC/PKCS5Padding.用于密码的密钥和用于块链接的IV通过对提供的密码(编码为UTF-8)与JVM配置特定的(通常为SHA1PRNG)64位随机盐串联一次来迭代SHA-256-.或两次.

The actual cipher is AES/CBC/PKCS5Padding. The key for the cipher and IV for the block chaining are derived iterating SHA-256-ing over the provided password (encoded as UTF-8) concatenated with a JVM-configuration-specific (usually SHA1PRNG) 64-bit random salt once or twice.

这里没有什么大的惊喜.如今,似乎其他所有人都使用这种格式.

No big surprises here. It seems to be on the same format every other soul is using nowadays.

有关血腥细节的信息,请阅读 GitHub项目页面

The gory details can be found reading the source on the GitHub project page

这篇关于mvn --encrypt-master-password< password>如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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