Skip to content

Instantly share code, notes, and snippets.

@yssharma
yssharma / AESTest.java
Last active April 28, 2022 03:26
Basic java code to Encrypt/Decrypt Files present on the HDFS. The code does not use Map-Reduce jobs for the process. The code is cross-platform compatible C# modules. The C# code would need little tweaking for cross-platform compatibility: aes.Padding = PaddingMode.PKCS7; aes.Mode = CipherMode.CBC; aes.KeySize = 128; aes.BlockSize = 128;
package com.test.aes;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.AlgorithmParameterSpec;