Apache Commons Crypto
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();
评论
Apache Commons CSV
CommonsCSV是一个用来读写各种CommaSeparatedValue(CSV)格式文件的Java库.Maven:<groupId>org.apache.commons</gr
Apache Commons CSV
0
Apache Commons Exec
ApacheCommonsExec是Apache上的一个Java项目,提供一些常用的方法用来执行外部进程,如下面代码所示:String line = "AcroRd32.exe /p /h " + f
Apache Commons Exec
0
Apache Commons JCS分布式缓存系统
Apache Commons JCS 是一个用 Java 编写的分布式、多功能的缓存系统,它旨在通过
Apache Commons JCS分布式缓存系统
0
Apache Commons SCXMLSCXML的Java实现
ApacheCommonsSCXML是SCXML引擎的Java实现版,最新发布的版本是0.9,但是功能基本上已经覆盖了SCXMLW3C规范的全部内容。
Apache Commons SCXMLSCXML的Java实现
0
Apache Commons ImagingJava 图像处理库
Apache Commons Imaging,以前被称为 Apache Commons Sansel
Apache Commons ImagingJava 图像处理库
0