Stream Cipher

Ads

 
 

Share on Google+Share on Google+

zzq
Stream Cipher
0 Answer(s)      6 years and 7 months ago
Posted in : Java Beginners

I want to encrypt data use two layer cipher as follow,but it seems not work, why and how, thanks´╝?

encrypt part´╝? Cipher cf1 = Cipher.getInstance(ciphAlg1); cf1.init(Cipher.ENCRYPT_MODE, key1, paramSpec); Cipher cf2 = Cipher.getInstance(ciphAlg2); cf2.init(Cipher.ENCRYPT_MODE, key2, paramSpec2);

FileInputStream fis = new FileInputStream(inputFile); FileOutputStream fos = new FileOutputStream(outputFile); CipherOutputStream cos1 = new CipherOutputStream(fos, cf1); CipherOutputStream cos2 = new CipherOutputStream(cos1, cf2);

decrypt part´╝? Cipher cf1 = Cipher.getInstance(ciphAlg1); cf1.init(Cipher.DECRYPT_MODE, key1, paramSpec); Cipher cf2 = Cipher.getInstance(ciphAlg2); cf2.init(Cipher.DECRYPT_MODE, key2, paramSpec2);

FileInputStream fis = new FileInputStream(inputFile); FileOutputStream fos = new FileOutputStream(outputFile);

CipherOutputStream cos1 = new CipherOutputStream(fos, cf2); CipherOutputStream cos2 = new CipherOutputStream(cos1, cf1);

One layer work well, but the double...

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Stream Cipher
Stream Cipher  I want to encrypt data use two layer cipher as follow,but it seems not work, why and how, thanks´╝? encrypt part´╝? Cipher cf1 = Cipher.getInstance(ciphAlg1); cf1.init(Cipher.ENCRYPT_MODE, key1, paramSpec); Cipher
a competitive study on cryptography techniques over block cipher
a competitive study on cryptography techniques over block cipher  i need "a competitive study on cryptography techniques over block cipher" project source code... plz reply to my post... for more information about this project
Advertisements
Java Stream
Java Stream   What is Stream and Types
Byte ? Oriented Stream and Character- Oriented Stream
Byte ? Oriented Stream and Character- Oriented Stream  difference between Byte ? Oriented Stream and Character- Oriented Stream
Byte ? Oriented Stream and Character- Oriented Stream
Byte ? Oriented Stream and Character- Oriented Stream  Difference between Byte ? Oriented Stream and Character- Oriented Stream
php stream functions
php stream functions  what does php stream functions do
Data input & output Stream
Data input & output Stream  Explain Data Input Stream and Data Output Stream Class.   DataInputStream and DataOutputStream A data input stream lets an application read primitive Java data types from an underlying input
I/O stream class.
I/O stream class.  Explain the hierarchy of Java I/O stream class.   Hierarchy of Java I/O streams Have a look at the following link: Java I/O
Java I/O stream
Java I/O stream  What class allows you to read objects directly from a stream
Version of com.annimon>stream dependency
List of Version of com.annimon>stream dependency
Compressed (ZLIB) Input Stream
Compressed (ZLIB) Input Stream  I have to make call to a web service which will send a compressed (ZLIB) stream back to me. I have to de-compress the same stream and use it further. My problem is that I have to get it done
Java Stream Write Exception
Java Stream Write Exception  I am doing socket programming. I have two files called Server.java and client.java. Both programs were running successfully and successfully sending data to each other. Yesterday I added the following
Version of com.nfsdb>nfsdb-stream dependency
List of Version of com.nfsdb>nfsdb-stream dependency
Version of com.annimon>stream-test dependency
List of Version of com.annimon>stream-test dependency
Version of com.bloidonia>groovy-stream dependency
List of Version of com.bloidonia>groovy-stream dependency
Version of com.nfsdb>nfsdb-stream dependency
List of Version of com.nfsdb>nfsdb-stream dependency
stream length not specified - Java Beginners
stream length not specified  our requirement is we need to send the audio data that is spoken by the client to the server and save it in a file. when we r using servlet applet technology we r getting stream length not specified
Maven Dependency stream >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.1 in your project
Maven Dependency stream >> 1.0.2
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.2 in your project
Maven Dependency stream >> 1.0.3
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.3 in your project
Maven Dependency stream >> 1.0.4
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.4 in your project
Maven Dependency stream >> 1.0.5
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.5 in your project
Maven Dependency stream >> 1.0.6
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.6 in your project
Maven Dependency stream >> 1.0.7
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.7 in your project
Maven Dependency stream >> 1.0.8
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.8 in your project
Maven Dependency stream >> 1.0.9
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.0.9 in your project
Maven Dependency stream >> 1.1.0
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.1.0 in your project
Maven Dependency stream >> 1.1.1
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.1.1 in your project
Maven Dependency stream >> 1.1.2
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.1.2 in your project
Maven Dependency stream >> 1.1.3
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.1.3 in your project
Maven Dependency stream >> 1.1.4
You should include the dependency code given in this page to add Maven Dependency of com.annimon >> stream version1.1.4 in your project

Ads

 
Advertisement null

Ads