Package org.refcodes.security.alt.chaos
Class ChaosDecryptionInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.refcodes.security.DecryptionInputStream
-
- org.refcodes.security.alt.chaos.ChaosDecryptionInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.refcodes.mixin.Disposable
public class ChaosDecryptionInputStream extends org.refcodes.security.DecryptionInputStream
AChaosDecryptionInputStream
wraps anInputStream
and consumes input bytes by applying aChaosDecrypter
on each byte read from the providedInputStream
before passing back the processed byte to the caller. The input of theChaosDecryptionInputStream
can be converted back by the accordingChaosEncryptionOutputStream
. In case salting is enabled in the rootChaosKey
, then theChaosDecryptionInputStream
initially decrypts heading bytes of anInputStream
which then are used as a saltChaosKey
finally decrypting the decrypted "salted" data (being created using theChaosEncryptionOutputStream
with salting enabled).
-
-
Constructor Summary
Constructors Constructor Description ChaosDecryptionInputStream(InputStream aInputStream, ChaosKey aKey)
Constructs theChaosDecryptionInputStream
using the givenChaosKey
for decrypting.
-
Method Summary
-
Methods inherited from class org.refcodes.security.DecryptionInputStream
available, close, dispose, equals, hashCode, mark, markSupported, read, read, read, reset, skip, toString
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ChaosDecryptionInputStream
public ChaosDecryptionInputStream(InputStream aInputStream, ChaosKey aKey) throws IOException
Constructs theChaosDecryptionInputStream
using the givenChaosKey
for decrypting.- Parameters:
aInputStream
- TheInputStream
to be wrapped.aKey
- TheChaosKey
to use for decrypting.*- Throws:
IOException
- Signals that an I/O exception has occurred while applying salting.
-
-