All Downloads are FREE. Search and download functionalities are using the official Maven repository.

prerna.security.SnowTest Maven / Gradle / Ivy

There is a newer version: 4.2.2
Show newest version
package prerna.security;
import java.io.PrintWriter;


public class SnowTest {

	Snow snow = new Snow();
	
	public void encryptMessage(String message, String password, String inputFile, String outputFile)
	{
		String [] args = {"-C", "-m", message, "-p", password, inputFile, outputFile};
		snow.runSnow(args);
		
	}
	
	public void decryptMessage(String password, String outputFile)
	{
		// -C  -p "hola" prop2.txt output.txt
		String [] args = {"-C", "-p",password, outputFile};
		snow.runSnow(args);
	}

	public void encryptFile(String fileToEncrypt, String password, String inputFile, String outputFile)
	{
		//-C -f prop.txt -p "hola" input.txt prop2.txt
		String [] args = {"-C", "-f", fileToEncrypt, "-p", password, inputFile, outputFile};
		snow.runSnow(args);
		
	}
	
	public void decryptFile(String fileToDecrypt, String password, String outputFile)
	{
		// -C  -p "hola" prop2.txt output.txt
		String [] args = {"-C", "-p","password", fileToDecrypt, outputFile};
		snow.runSnow(args);
	}

	public static void main(String[] args)
	{
		SnowTest snow = new SnowTest();
		// encrypt the file
		//snow.encryptFile("C:\\Users\\pkapaleeswaran\\workspacej3\\Exp\\message.txt", "password", "C:\\Users\\pkapaleeswaran\\workspacej3\\Exp\\input.txt", "C:\\Users\\pkapaleeswaran\\workspacej3\\Exp\\output.txt");

		snow.decryptFile("C:\\Users\\pkapaleeswaran\\workspacej3\\Exp\\output.txt", "password", "C:\\Users\\pkapaleeswaran\\workspacej3\\Exp\\decrypt.txt");
		
	}	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy