Apache Commons Crypto 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
Apache Commons Crypto 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
Apache Commons Crypto 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 Apache
开发语言 Java
操作系统 跨平台
软件类型 开源软件
开源组织 Apache
地区 不详
投 递 者 红薯
适用人群 未知
收录时间 2016-05-10

软件简介

Apache Commons Crypto 是一个加密库,使用 AES-NI (Advanced Encryption Standard New Instructions) 进行优化。提供了加密级别和流级别的 API。开发者可以使用最少代码来实现高性能的 AES 加解密应用。

Maven:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-crypto</artifactId>
    <version>1.0.0</version>
</dependency>

示例代码:

Properties properties = new Properties();
//Creates a CryptoCipher instance with the transformation and properties.
CryptoCipher cipher = Utils.getCipherInstance(CipherTransformation.AES_CTR_NOPADDING, properties);

String input = "hello world!";
int inputOffset = 0;
int inputLen = input.length();
byte[] output = new byte[1024];
int outputOffset = 0;
//Initializes the cipher with ENCRYPT_MODE, key and iv.
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key,"AES"), new IvParameterSpec(iv));
//Continues a multiple-part encryption/decryption operation for byte array.
cipher.update(input.getBytes("UTF-8"), inputOffset, inputLen, output, outputOffset);
//We should call do final at the end of encryption/decryption.
cipher.doFinal(inBuffer, outBuffer);
//Closes the cipher.
cipher.close();
展开阅读全文

评论

点击加入讨论🔥(3) 发布并加入讨论🔥
发表了资讯
2016/08/10 00:00

Apache Commons Crypto 1.0.0 发布

Apache Commons Crypto 1.0.0 发布了。Apache Commons Crypto 是一个加密库,使用 AES-NI (Advanced Encryption Standard New Instructions) 进行优化。提供了加密级别和流级别的 API。开发者可以使用最少代码来实现高性能的 AES 加解密应用。 新特性: CRYPTO-68: Enable common code quality reports. CRYPTO-11: User guide documentation . Thanks to Ke Jia, Jerry Chen. CRYPTO-12: Rename CryptoInputStream to CipherIn...

11
50
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
3 评论
133 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部