From e300b3c294c84ec771d865376ffb698cdd687787 Mon Sep 17 00:00:00 2001 From: hisahi Date: Wed, 17 Apr 2019 18:01:04 +0300 Subject: [PATCH] update docs and add javadoc --- README.md | 4 +- doc/javadoc/allclasses-frame.html | 45 + doc/javadoc/allclasses-noframe.html | 45 + .../tiralabradesaes/Base64OutputStream.html | 341 ++++++++ .../tiralabradesaes/HexOutputStream.html | 341 ++++++++ .../hisahi/tiralabradesaes/MT19937.html | 317 +++++++ .../tiralabradesaes/PaddingRemoverWriter.html | 318 +++++++ .../tiralabradesaes/StreamBlockReader.html | 323 +++++++ .../github/hisahi/tiralabradesaes/Utils.html | 523 +++++++++++ .../tiralabradesaes/VoidOutputStream.html | 300 +++++++ .../blockmodes/BlockModeCBC.html | 410 +++++++++ .../blockmodes/BlockModeCTR.html | 412 +++++++++ .../blockmodes/BlockModeECB.html | 412 +++++++++ .../blockmodes/IBlockMode.html | 334 +++++++ .../blockmodes/package-frame.html | 26 + .../blockmodes/package-summary.html | 182 ++++ .../blockmodes/package-tree.html | 141 +++ .../tiralabradesaes/ciphers/CipherAES.html | 410 +++++++++ .../ciphers/CipherChaCha20.html | 365 ++++++++ .../tiralabradesaes/ciphers/CipherDES.html | 409 +++++++++ .../ciphers/CipherTripleDES.html | 411 +++++++++ .../tiralabradesaes/ciphers/IBlockCipher.html | 339 +++++++ .../ciphers/IStreamCipher.html | 300 +++++++ .../ciphers/package-frame.html | 28 + .../ciphers/package-summary.html | 195 +++++ .../tiralabradesaes/ciphers/package-tree.html | 143 +++ .../hisahi/tiralabradesaes/hash/HashSHA1.html | 355 ++++++++ .../tiralabradesaes/hash/HashSHA2_224.html | 415 +++++++++ .../tiralabradesaes/hash/HashSHA2_256.html | 540 ++++++++++++ .../tiralabradesaes/hash/HashSHA2_384.html | 415 +++++++++ .../tiralabradesaes/hash/HashSHA2_512.html | 540 ++++++++++++ .../tiralabradesaes/hash/IHashFunction.html | 290 ++++++ .../tiralabradesaes/hash/package-frame.html | 28 + .../tiralabradesaes/hash/package-summary.html | 194 ++++ .../tiralabradesaes/hash/package-tree.html | 149 ++++ .../keyderiv/HMACFunction.html | 350 ++++++++ .../keyderiv/IKeyDerivation.html | 313 +++++++ .../keyderiv/KeyDerivPBKDF2.html | 391 +++++++++ .../keyderiv/package-frame.html | 25 + .../keyderiv/package-summary.html | 180 ++++ .../keyderiv/package-tree.html | 140 +++ .../hisahi/tiralabradesaes/package-frame.html | 26 + .../tiralabradesaes/package-summary.html | 193 ++++ .../hisahi/tiralabradesaes/package-tree.html | 145 +++ .../hisahi/tiralabradesaes/ui/TestMain.html | 305 +++++++ .../tiralabradesaes/ui/VoidOutputStream.html | 294 +++++++ .../tiralabradesaes/ui/package-frame.html | 20 + .../tiralabradesaes/ui/package-summary.html | 151 ++++ .../tiralabradesaes/ui/package-tree.html | 135 +++ doc/javadoc/constant-values.html | 122 +++ doc/javadoc/deprecated-list.html | 122 +++ doc/javadoc/help-doc.html | 223 +++++ doc/javadoc/index-all.html | 825 ++++++++++++++++++ doc/javadoc/index.html | 75 ++ doc/javadoc/overview-frame.html | 26 + doc/javadoc/overview-summary.html | 174 ++++ doc/javadoc/overview-tree.html | 179 ++++ doc/javadoc/package-list | 6 + doc/javadoc/script.js | 30 + doc/javadoc/stylesheet.css | 574 ++++++++++++ doc/ohje.md | 3 +- doc/toteutus.md | 6 +- doc/viikko6.md | 9 + 63 files changed, 15037 insertions(+), 5 deletions(-) create mode 100644 doc/javadoc/allclasses-frame.html create mode 100644 doc/javadoc/allclasses-noframe.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/Base64OutputStream.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/HexOutputStream.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/MT19937.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/PaddingRemoverWriter.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/StreamBlockReader.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/Utils.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/VoidOutputStream.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCBC.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCTR.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeECB.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/IBlockMode.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-frame.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-summary.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-tree.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherAES.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherChaCha20.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherDES.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherTripleDES.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IBlockCipher.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IStreamCipher.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-frame.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-summary.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-tree.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA1.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_224.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_256.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_384.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_512.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/IHashFunction.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-frame.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-summary.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-tree.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/HMACFunction.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/IKeyDerivation.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/KeyDerivPBKDF2.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-frame.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-summary.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-tree.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/package-frame.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/package-summary.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/package-tree.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ui/TestMain.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ui/VoidOutputStream.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-frame.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-summary.html create mode 100644 doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-tree.html create mode 100644 doc/javadoc/constant-values.html create mode 100644 doc/javadoc/deprecated-list.html create mode 100644 doc/javadoc/help-doc.html create mode 100644 doc/javadoc/index-all.html create mode 100644 doc/javadoc/index.html create mode 100644 doc/javadoc/overview-frame.html create mode 100644 doc/javadoc/overview-summary.html create mode 100644 doc/javadoc/overview-tree.html create mode 100644 doc/javadoc/package-list create mode 100644 doc/javadoc/script.js create mode 100644 doc/javadoc/stylesheet.css create mode 100644 doc/viikko6.md diff --git a/README.md b/README.md index 4c3030b..5320a48 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,10 @@ Tietorakenteiden ja algoritmien harjoitustyö periodille IV 2018-2019. Tarkoituksena on verrata DES, 3DES, AES (useita eri moodeja, kuten ECB, CBC, CTR), tarkalleen ottaen niiden nopeuksia, muistin käyttöä sekä toteutusta. * [Vaatimusmäärittely](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/vaatimusmaarittely.md) -* Viikkoraportit: [1](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko1.md) [2](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko2.md) [3](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko3.md) [4](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko4.md) [5](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko5.md) +* Viikkoraportit: [1](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko1.md) [2](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko2.md) [3](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko3.md) [4](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko4.md) [5](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko5.md) [6](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/viikko6.md) * [Testaus](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/testaus.md) * [Toteutus](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/toteutus.md) * [Käyttöohje](https://github.com/hisahi/tiralabra-2019-des-aes/blob/master/doc/ohje.md) +* [Javadocs](https://github.com/hisahi/tiralabra-2019-des-aes/tree/master/doc/javadoc) + diff --git a/doc/javadoc/allclasses-frame.html b/doc/javadoc/allclasses-frame.html new file mode 100644 index 0000000..9951ee6 --- /dev/null +++ b/doc/javadoc/allclasses-frame.html @@ -0,0 +1,45 @@ + + + + + +All Classes (kryptoa API) + + + + + +

All Classes

+
+ +
+ + diff --git a/doc/javadoc/allclasses-noframe.html b/doc/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..e03a42a --- /dev/null +++ b/doc/javadoc/allclasses-noframe.html @@ -0,0 +1,45 @@ + + + + + +All Classes (kryptoa API) + + + + + +

All Classes

+
+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/Base64OutputStream.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/Base64OutputStream.html new file mode 100644 index 0000000..8c7ea69 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/Base64OutputStream.html @@ -0,0 +1,341 @@ + + + + + +Base64OutputStream (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class Base64OutputStream

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    +
    +
    +
    +
    public class Base64OutputStream
    +extends java.io.OutputStream
    +
    An output stream that writes the bytes encoded as Base64 into the + underlying PrintStream. When the HexOutputStream is closed, it will + also write a newline to the underlying PrintStream.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Base64OutputStream(java.io.PrintStream out) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidclose() 
      voidflush() 
      voidwrite(int b) 
      +
        +
      • + + +

        Methods inherited from class java.io.OutputStream

        +write, write
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Base64OutputStream

        +
        public Base64OutputStream(java.io.PrintStream out)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        write

        +
        public void write(int b)
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        write in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        flush

        +
        public void flush()
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        flush in interface java.io.Flushable
        +
        Overrides:
        +
        flush in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        close in interface java.io.Closeable
        +
        Specified by:
        +
        close in interface java.lang.AutoCloseable
        +
        Overrides:
        +
        close in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/HexOutputStream.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/HexOutputStream.html new file mode 100644 index 0000000..4652ba0 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/HexOutputStream.html @@ -0,0 +1,341 @@ + + + + + +HexOutputStream (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class HexOutputStream

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    +
    +
    +
    +
    public class HexOutputStream
    +extends java.io.OutputStream
    +
    An output stream that writes the bytes encoded as hexadecimal digits into + the underlying PrintStream. When the HexOutputStream is closed, it will + also write a newline to the underlying PrintStream.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HexOutputStream(java.io.PrintStream out) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidclose() 
      voidflush() 
      voidwrite(int b) 
      +
        +
      • + + +

        Methods inherited from class java.io.OutputStream

        +write, write
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HexOutputStream

        +
        public HexOutputStream(java.io.PrintStream out)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        write

        +
        public void write(int b)
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        write in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        flush

        +
        public void flush()
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        flush in interface java.io.Flushable
        +
        Overrides:
        +
        flush in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        close in interface java.io.Closeable
        +
        Specified by:
        +
        close in interface java.lang.AutoCloseable
        +
        Overrides:
        +
        close in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/MT19937.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/MT19937.html new file mode 100644 index 0000000..57c1dde --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/MT19937.html @@ -0,0 +1,317 @@ + + + + + +MT19937 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class MT19937

+
+
+ +
+
    +
  • +
    +
    +
    public class MT19937
    +extends java.lang.Object
    +
    A MT19937 (Mersenne Twister) random number generator.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MT19937() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidnextBytes(byte[] res) +
      Fills the given byte array with random bytes.
      +
      intnextInt() +
      Returns the next random number from the generator.
      +
      voidsetSeed(int seed) +
      Sets the new seed for the Mersenne Twister.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MT19937

        +
        public MT19937()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setSeed

        +
        public void setSeed(int seed)
        +
        Sets the new seed for the Mersenne Twister.
        +
        +
        Parameters:
        +
        seed - The new seed to use.
        +
        +
      • +
      + + + +
        +
      • +

        nextInt

        +
        public int nextInt()
        +
        Returns the next random number from the generator.
        +
        +
        Returns:
        +
        The next random number as a 32-bit int.
        +
        +
      • +
      + + + +
        +
      • +

        nextBytes

        +
        public void nextBytes(byte[] res)
        +
        Fills the given byte array with random bytes.
        +
        +
        Parameters:
        +
        res - The byte array to fill.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/PaddingRemoverWriter.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/PaddingRemoverWriter.html new file mode 100644 index 0000000..21b32d2 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/PaddingRemoverWriter.html @@ -0,0 +1,318 @@ + + + + + +PaddingRemoverWriter (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class PaddingRemoverWriter

+
+
+ +
+
    +
  • +
    +
    +
    public class PaddingRemoverWriter
    +extends java.lang.Object
    +
    A class that writes to an OutputStream, removing PKCS padding from the + blocks it has been given.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PaddingRemoverWriter(java.io.OutputStream os, + int byteSize) +
      Constructs a PaddingRemoverWriter instance from an OutputStream to + write to and block size in bytes.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intfeedBlock(byte[] block) +
      Feeds a block of data with byteSize bytes into the stream.
      +
      intfinish() +
      To be called when there are no more blocks to feed.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PaddingRemoverWriter

        +
        public PaddingRemoverWriter(java.io.OutputStream os,
        +                            int byteSize)
        +
        Constructs a PaddingRemoverWriter instance from an OutputStream to + write to and block size in bytes.
        +
        +
        Parameters:
        +
        os - The OutputStream to write to.
        +
        byteSize - The block size in bytes.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        feedBlock

        +
        public int feedBlock(byte[] block)
        +              throws java.io.IOException
        +
        Feeds a block of data with byteSize bytes into the stream.
        +
        +
        Parameters:
        +
        block - The block of data to feed.
        +
        Returns:
        +
        The number of bytes written to the output stream.
        +
        Throws:
        +
        java.io.IOException - When OutputStream to be written to throws an error.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public int finish()
        +           throws java.io.IOException
        +
        To be called when there are no more blocks to feed.
        +
        +
        Returns:
        +
        The number of bytes written to the output stream.
        +
        Throws:
        +
        java.io.IOException - In case the underlying stream throws an exception.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/StreamBlockReader.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/StreamBlockReader.html new file mode 100644 index 0000000..b789678 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/StreamBlockReader.html @@ -0,0 +1,323 @@ + + + + + +StreamBlockReader (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class StreamBlockReader

+
+
+ +
+
    +
  • +
    +
    +
    public class StreamBlockReader
    +extends java.lang.Object
    +
    Represents a blocked version of InputStream that converts a stream into + blocks suitable for encryption and decryption with block ciphers.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      StreamBlockReader(java.io.InputStream inp, + int byteSize) +
      Creates a new BlockInputStream from an existing InputStream and a size + of the block in bytes (* 8 for size in bits).
      +
      StreamBlockReader(java.io.InputStream inp, + int byteSize, + boolean allowPadding) +
      Creates a new BlockInputStream from an existing InputStream and a size + of the block in bytes (* 8 for size in bits).
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]nextBlock() +
      Reads the next block from the stream.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StreamBlockReader

        +
        public StreamBlockReader(java.io.InputStream inp,
        +                         int byteSize)
        +
        Creates a new BlockInputStream from an existing InputStream and a size + of the block in bytes (* 8 for size in bits).
        +
        +
        Parameters:
        +
        inp - The InputStream to wrap.
        +
        byteSize - The size of the block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        StreamBlockReader

        +
        public StreamBlockReader(java.io.InputStream inp,
        +                         int byteSize,
        +                         boolean allowPadding)
        +
        Creates a new BlockInputStream from an existing InputStream and a size + of the block in bytes (* 8 for size in bits).
        +
        +
        Parameters:
        +
        inp - The InputStream to wrap.
        +
        byteSize - The size of the block in bytes.
        +
        allowPadding - Whether to add PKCS padding to the stream.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        nextBlock

        +
        public byte[] nextBlock()
        +                 throws java.io.IOException
        +
        Reads the next block from the stream. The block will be padded to the + given size, or null if the end-of-stream has been reached. Note that the + byte array will be overwritten by this function, as the class only + maintains a single buffer.
        +
        +
        Returns:
        +
        The next block, or null if the end of stream has been reached.
        +
        Throws:
        +
        java.io.IOException - If the underlying InputStream fails to read.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/Utils.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/Utils.html new file mode 100644 index 0000000..ff0f5c8 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/Utils.html @@ -0,0 +1,523 @@ + + + + + +Utils (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class Utils

+
+
+ +
+
    +
  • +
    +
    +
    public final class Utils
    +extends java.lang.Object
    +
    Various utility functions to be used by other code. Cannot be instantiated.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static byte[]convertBase64ToBytes(java.lang.String str) +
      Converts the given Base64 string to a byte array.
      +
      static java.lang.StringconvertBytesToHex(byte[] b) +
      Converts the given byte array into a hex string consisting of + two hex digits for each byte, not separated with spaces or anything + else.
      +
      static byte[]convertHexToBytes(java.lang.String str) +
      Converts the given hex string to a byte array.
      +
      static intdestroyArray(byte[] arr) +
      Wipes the contents of the given byte[] array.
      +
      static intdestroyArray(int[] arr) +
      Wipes the contents of the given int[] array.
      +
      static voiddumpBlock(byte[] block, + int length) +
      Dumps the given byte array with the given length into the standard + output as hex.
      +
      static voidgenerateStrongRandom(byte[] res) +
      Fills the given byte array with random bytes generated using a + cryptographically secure pseudo random number generator.
      +
      static voidgenerateWeakRandom(byte[] res) +
      Fills the given byte array with random bytes NOT suitable for + cryptographic purposes.
      +
      static byte[]prepare3DESKey(byte[] rawKey) +
      Converts a 21-byte 168-bit 3DES key to the full 24-byte 192-bit 3DES key.
      +
      static byte[]prepare3DESKeyFrom14Bytes(byte[] rawKey) +
      Converts a 14-byte 112-bit 3DES key to the full 24-byte 192-bit 3DES key.
      +
      static byte[]prepare3DESKeyFrom16Bytes(byte[] rawKey) +
      Converts a 16-byte 128-bit 3DES key to the full 24-byte 192-bit 3DES key.
      +
      static byte[]prepareDESKey(byte[] rawKey) +
      Converts a 7-byte 56-bit DES key to the full 8-byte 64-bit DES key.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        prepareDESKey

        +
        public static byte[] prepareDESKey(byte[] rawKey)
        +
        Converts a 7-byte 56-bit DES key to the full 8-byte 64-bit DES key. + These keys both contain 56 bits of information and therefore have 56 + bits of security; the remaining 8 bits are parity bits.
        +
        +
        Parameters:
        +
        rawKey - The 7-byte 56-bit DES key.
        +
        Returns:
        +
        The given key as an 8-byte 64-bit DES key with 56 bits of + security.
        +
        +
      • +
      + + + +
        +
      • +

        prepare3DESKeyFrom14Bytes

        +
        public static byte[] prepare3DESKeyFrom14Bytes(byte[] rawKey)
        +
        Converts a 14-byte 112-bit 3DES key to the full 24-byte 192-bit 3DES key. + The resulting key will have 112 bits of security, with the third key + being equivalent to the first key.
        +
        +
        Parameters:
        +
        rawKey - The 14-byte 112-bit 3DES key.
        +
        Returns:
        +
        The given key as an 24-byte 192-bit 3DES key with 112 bits of + security.
        +
        +
      • +
      + + + +
        +
      • +

        prepare3DESKey

        +
        public static byte[] prepare3DESKey(byte[] rawKey)
        +
        Converts a 21-byte 168-bit 3DES key to the full 24-byte 192-bit 3DES key. + These keys both contain 168 bits of information and therefore have 168 + bits of security; the remaining 24 bits are parity bits.
        +
        +
        Parameters:
        +
        rawKey - The 21-byte 168-bit 3DES key.
        +
        Returns:
        +
        The given key as an 24-byte 192-bit 3DES key with 168 bits of + security.
        +
        +
      • +
      + + + +
        +
      • +

        prepare3DESKeyFrom16Bytes

        +
        public static byte[] prepare3DESKeyFrom16Bytes(byte[] rawKey)
        +
        Converts a 16-byte 128-bit 3DES key to the full 24-byte 192-bit 3DES key. + The resulting key will have 112 bits of security, with the third key + being equivalent to the first key.
        +
        +
        Parameters:
        +
        rawKey - The 16-byte 128-bit 3DES key.
        +
        Returns:
        +
        The given key as an 24-byte 192-bit 3DES key with 112 bits of + security.
        +
        +
      • +
      + + + +
        +
      • +

        destroyArray

        +
        public static int destroyArray(byte[] arr)
        +
        Wipes the contents of the given byte[] array.
        +
        +
        Parameters:
        +
        arr - The array to wipe.
        +
        Returns:
        +
        Meaningless number.
        +
        +
      • +
      + + + +
        +
      • +

        destroyArray

        +
        public static int destroyArray(int[] arr)
        +
        Wipes the contents of the given int[] array.
        +
        +
        Parameters:
        +
        arr - The array to wipe.
        +
        Returns:
        +
        Meaningless number.
        +
        +
      • +
      + + + +
        +
      • +

        convertHexToBytes

        +
        public static byte[] convertHexToBytes(java.lang.String str)
        +
        Converts the given hex string to a byte array. The string is expected + to contain an even number of hex digits, possibly spaced apart. If the + format is not recognized, the function will return null. + + An empty string will not return null but an empty byte array, that is + a byte[] with length 0.
        +
        +
        Parameters:
        +
        str - The hex string to convert.
        +
        Returns:
        +
        The converted byte array or null if the string is invalid.
        +
        +
      • +
      + + + +
        +
      • +

        convertBase64ToBytes

        +
        public static byte[] convertBase64ToBytes(java.lang.String str)
        +
        Converts the given Base64 string to a byte array. The string is expected + to contain only Base64 digits without any spacing. Digits 62 and 63 + are + and / and the padding character is =. + + An empty string will not return null but an empty byte array, that is + a byte[] with length 0.
        +
        +
        Parameters:
        +
        str - The Base64 string to convert.
        +
        Returns:
        +
        The converted byte array or null if the string is invalid.
        +
        +
      • +
      + + + +
        +
      • +

        convertBytesToHex

        +
        public static java.lang.String convertBytesToHex(byte[] b)
        +
        Converts the given byte array into a hex string consisting of + two hex digits for each byte, not separated with spaces or anything + else. The hex digits will be in lowercase.
        +
        +
        Parameters:
        +
        b - The byte array to convert.
        +
        Returns:
        +
        The byte array as a hex string.
        +
        +
      • +
      + + + +
        +
      • +

        generateWeakRandom

        +
        public static void generateWeakRandom(byte[] res)
        +
        Fills the given byte array with random bytes NOT suitable for + cryptographic purposes. + + Implementation detail: MT19937 is used to generate the numbers.
        +
        +
        Parameters:
        +
        res - The byte array to fill.
        +
        +
      • +
      + + + +
        +
      • +

        generateStrongRandom

        +
        public static void generateStrongRandom(byte[] res)
        +
        Fills the given byte array with random bytes generated using a + cryptographically secure pseudo random number generator. + + Implementation detail: ChaCha20, a stream cipher, is used to + generate the numbers; it is supplied a (weakly) random key and + nonce, after which the cipher will supply strongly random + numbers.
        +
        +
        Parameters:
        +
        res - The byte array to fill.
        +
        +
      • +
      + + + +
        +
      • +

        dumpBlock

        +
        public static void dumpBlock(byte[] block,
        +                             int length)
        +
        Dumps the given byte array with the given length into the standard + output as hex. This function is primarily for debugging purposes.
        +
        +
        Parameters:
        +
        block - The block to dump into standard output.
        +
        length - The length of the block to dump.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/VoidOutputStream.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/VoidOutputStream.html new file mode 100644 index 0000000..55741ca --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/VoidOutputStream.html @@ -0,0 +1,300 @@ + + + + + +VoidOutputStream (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes
+

Class VoidOutputStream

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    +
    +
    +
    +
    public class VoidOutputStream
    +extends java.io.OutputStream
    +
    An OutputStream that writes nowhere. It moves all bits to the + hundred-and-twenty-seventh section of the bit space.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      VoidOutputStream() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidwrite(int b) +
      Does nothing.
      +
      +
        +
      • + + +

        Methods inherited from class java.io.OutputStream

        +close, flush, write, write
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        VoidOutputStream

        +
        public VoidOutputStream()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        write

        +
        public void write(int b)
        +           throws java.io.IOException
        +
        Does nothing.
        +
        +
        Specified by:
        +
        write in class java.io.OutputStream
        +
        Parameters:
        +
        b - Any number you want.
        +
        Throws:
        +
        java.io.IOException - If this function can actually solve 3SAT in + polynomial time.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCBC.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCBC.html new file mode 100644 index 0000000..3f0d4da --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCBC.html @@ -0,0 +1,410 @@ + + + + + +BlockModeCBC (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.blockmodes
+

Class BlockModeCBC

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IBlockMode
    +
    +
    +
    +
    public class BlockModeCBC
    +extends java.lang.Object
    +implements IBlockMode
    +
    Implements the CBC, or Cipher Block Chaining, block mode of operation. + CBC XORs the blocks of plaintext with the earlier block of ciphertext.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      BlockModeCBC(IBlockCipher cipher) +
      Initializes the CBC block mode with the cipher to call process() with.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finishes the block mode of operation, after which it has to be + initialized again for it to work.
      +
      voidinitDecrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for decrypting blocks.
      +
      voidinitEncrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for encrypting blocks.
      +
      booleanisValidIVSize(int bytes) +
      Checks whether the given IV size is valid.
      +
      byte[]process(byte[] data) +
      Processes a single block of plaintext.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BlockModeCBC

        +
        public BlockModeCBC(IBlockCipher cipher)
        +
        Initializes the CBC block mode with the cipher to call process() with.
        +
        +
        Parameters:
        +
        cipher - The cipher to call process() with.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValidIVSize

        +
        public boolean isValidIVSize(int bytes)
        +
        Description copied from interface: IBlockMode
        +
        Checks whether the given IV size is valid.
        +
        +
        Specified by:
        +
        isValidIVSize in interface IBlockMode
        +
        Parameters:
        +
        bytes - The proposed size of the IV in bytes,
        +
        Returns:
        +
        Whether an IV with the size matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        public void initEncrypt(byte[] key,
        +                        byte[] iv)
        +
        Description copied from interface: IBlockMode
        +
        Initializes the block cipher mode of operation for encrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Specified by:
        +
        initEncrypt in interface IBlockMode
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        public void initDecrypt(byte[] key,
        +                        byte[] iv)
        +
        Description copied from interface: IBlockMode
        +
        Initializes the block cipher mode of operation for decrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Specified by:
        +
        initDecrypt in interface IBlockMode
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] data)
        +
        Description copied from interface: IBlockMode
        +
        Processes a single block of plaintext. The intended workflow is:
          +
        1. init block mode with key and IV; initializes block cipher
        2. +
        3. call block mode process to encrypt or decrypt a plaintext block
        4. +
        5. finish block mode, which will also finish the cipher
        6. +
        + + Note that the given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IBlockMode
        +
        Parameters:
        +
        data - The block of plaintext data to process.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IBlockMode
        +
        Finishes the block mode of operation, after which it has to be + initialized again for it to work.
        +
        +
        Specified by:
        +
        finish in interface IBlockMode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCTR.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCTR.html new file mode 100644 index 0000000..bbfb39e --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeCTR.html @@ -0,0 +1,412 @@ + + + + + +BlockModeCTR (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.blockmodes
+

Class BlockModeCTR

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IBlockMode
    +
    +
    +
    +
    public class BlockModeCTR
    +extends java.lang.Object
    +implements IBlockMode
    +
    Implements the CTR, or Counter, block mode of operation. + CTR turns the block cipher into a stream cipher, using a XOR of + the IV and an incrementing counter as the "plaintext" and XORing the result + with the real plaintext.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      BlockModeCTR(IBlockCipher cipher) +
      Initializes the CTR block mode with the cipher to call process() with.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finishes the block mode of operation, after which it has to be + initialized again for it to work.
      +
      voidinitDecrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for decrypting blocks.
      +
      voidinitEncrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for encrypting blocks.
      +
      booleanisValidIVSize(int bytes) +
      Checks whether the given IV size is valid.
      +
      byte[]process(byte[] data) +
      Processes a single block of plaintext.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BlockModeCTR

        +
        public BlockModeCTR(IBlockCipher cipher)
        +
        Initializes the CTR block mode with the cipher to call process() with.
        +
        +
        Parameters:
        +
        cipher - The cipher to call process() with.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValidIVSize

        +
        public boolean isValidIVSize(int bytes)
        +
        Description copied from interface: IBlockMode
        +
        Checks whether the given IV size is valid.
        +
        +
        Specified by:
        +
        isValidIVSize in interface IBlockMode
        +
        Parameters:
        +
        bytes - The proposed size of the IV in bytes,
        +
        Returns:
        +
        Whether an IV with the size matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        public void initEncrypt(byte[] key,
        +                        byte[] iv)
        +
        Description copied from interface: IBlockMode
        +
        Initializes the block cipher mode of operation for encrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Specified by:
        +
        initEncrypt in interface IBlockMode
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        public void initDecrypt(byte[] key,
        +                        byte[] iv)
        +
        Description copied from interface: IBlockMode
        +
        Initializes the block cipher mode of operation for decrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Specified by:
        +
        initDecrypt in interface IBlockMode
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] data)
        +
        Description copied from interface: IBlockMode
        +
        Processes a single block of plaintext. The intended workflow is:
          +
        1. init block mode with key and IV; initializes block cipher
        2. +
        3. call block mode process to encrypt or decrypt a plaintext block
        4. +
        5. finish block mode, which will also finish the cipher
        6. +
        + + Note that the given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IBlockMode
        +
        Parameters:
        +
        data - The block of plaintext data to process.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IBlockMode
        +
        Finishes the block mode of operation, after which it has to be + initialized again for it to work.
        +
        +
        Specified by:
        +
        finish in interface IBlockMode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeECB.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeECB.html new file mode 100644 index 0000000..a7ed42c --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/BlockModeECB.html @@ -0,0 +1,412 @@ + + + + + +BlockModeECB (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.blockmodes
+

Class BlockModeECB

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IBlockMode
    +
    +
    +
    +
    public class BlockModeECB
    +extends java.lang.Object
    +implements IBlockMode
    +
    Implements the ECB, or Electronic Code Book, block mode of operation. + ECB does not modify the plaintext blocks in any way when passing them to + a cipher, meaning that repeating blocks will also be repeating in the + resulting stream of ciphertext.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      BlockModeECB(IBlockCipher cipher) +
      Initializes the ECB block mode with the cipher to call process() with.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finishes the block mode of operation, after which it has to be + initialized again for it to work.
      +
      voidinitDecrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for decrypting blocks.
      +
      voidinitEncrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for encrypting blocks.
      +
      booleanisValidIVSize(int bytes) +
      Checks whether the given IV size is valid.
      +
      byte[]process(byte[] data) +
      Processes a single block of plaintext.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BlockModeECB

        +
        public BlockModeECB(IBlockCipher cipher)
        +
        Initializes the ECB block mode with the cipher to call process() with.
        +
        +
        Parameters:
        +
        cipher - The cipher to call process() with.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValidIVSize

        +
        public boolean isValidIVSize(int bytes)
        +
        Description copied from interface: IBlockMode
        +
        Checks whether the given IV size is valid.
        +
        +
        Specified by:
        +
        isValidIVSize in interface IBlockMode
        +
        Parameters:
        +
        bytes - The proposed size of the IV in bytes,
        +
        Returns:
        +
        Whether an IV with the size matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        public void initEncrypt(byte[] key,
        +                        byte[] iv)
        +
        Description copied from interface: IBlockMode
        +
        Initializes the block cipher mode of operation for encrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Specified by:
        +
        initEncrypt in interface IBlockMode
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        public void initDecrypt(byte[] key,
        +                        byte[] iv)
        +
        Description copied from interface: IBlockMode
        +
        Initializes the block cipher mode of operation for decrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Specified by:
        +
        initDecrypt in interface IBlockMode
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] data)
        +
        Description copied from interface: IBlockMode
        +
        Processes a single block of plaintext. The intended workflow is:
          +
        1. init block mode with key and IV; initializes block cipher
        2. +
        3. call block mode process to encrypt or decrypt a plaintext block
        4. +
        5. finish block mode, which will also finish the cipher
        6. +
        + + Note that the given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IBlockMode
        +
        Parameters:
        +
        data - The block of plaintext data to process.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IBlockMode
        +
        Finishes the block mode of operation, after which it has to be + initialized again for it to work.
        +
        +
        Specified by:
        +
        finish in interface IBlockMode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/IBlockMode.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/IBlockMode.html new file mode 100644 index 0000000..c4b567e --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/IBlockMode.html @@ -0,0 +1,334 @@ + + + + + +IBlockMode (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.blockmodes
+

Interface IBlockMode

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finishes the block mode of operation, after which it has to be + initialized again for it to work.
      +
      voidinitDecrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for decrypting blocks.
      +
      voidinitEncrypt(byte[] key, + byte[] iv) +
      Initializes the block cipher mode of operation for encrypting blocks.
      +
      booleanisValidIVSize(int bytes) +
      Checks whether the given IV size is valid.
      +
      byte[]process(byte[] data) +
      Processes a single block of plaintext.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValidIVSize

        +
        boolean isValidIVSize(int bytes)
        +
        Checks whether the given IV size is valid.
        +
        +
        Parameters:
        +
        bytes - The proposed size of the IV in bytes,
        +
        Returns:
        +
        Whether an IV with the size matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        void initEncrypt(byte[] key,
        +                 byte[] iv)
        +
        Initializes the block cipher mode of operation for encrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        void initDecrypt(byte[] key,
        +                 byte[] iv)
        +
        Initializes the block cipher mode of operation for decrypting blocks. + Guaranteed to be called before either process() or finish(). + Calling again is invalid before finish() is called. This will also + initialize the underlying block cipher with the given key.
        +
        +
        Parameters:
        +
        key - The key to initialize the cipher with. May not be null.
        +
        iv - The IV or initialization vector. May only be null when the + block cipher mode of operation does not accept IVs.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        byte[] process(byte[] data)
        +
        Processes a single block of plaintext. The intended workflow is:
          +
        1. init block mode with key and IV; initializes block cipher
        2. +
        3. call block mode process to encrypt or decrypt a plaintext block
        4. +
        5. finish block mode, which will also finish the cipher
        6. +
        + + Note that the given byte array might be modified by the implementation.
        +
        +
        Parameters:
        +
        data - The block of plaintext data to process.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        void finish()
        +
        Finishes the block mode of operation, after which it has to be + initialized again for it to work.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-frame.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-frame.html new file mode 100644 index 0000000..2d39292 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-frame.html @@ -0,0 +1,26 @@ + + + + + +com.github.hisahi.tiralabradesaes.blockmodes (kryptoa API) + + + + + +

com.github.hisahi.tiralabradesaes.blockmodes

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-summary.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-summary.html new file mode 100644 index 0000000..d170292 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-summary.html @@ -0,0 +1,182 @@ + + + + + +com.github.hisahi.tiralabradesaes.blockmodes (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Package com.github.hisahi.tiralabradesaes.blockmodes

+
+
Package containing the block cipher mode of operation interface + as well as three implementations for it: ECB, CBC and CTR.
+
+

See: Description

+
+
+ + + + +

Package com.github.hisahi.tiralabradesaes.blockmodes Description

+
Package containing the block cipher mode of operation interface + as well as three implementations for it: ECB, CBC and CTR.
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-tree.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-tree.html new file mode 100644 index 0000000..a6a8f75 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/blockmodes/package-tree.html @@ -0,0 +1,141 @@ + + + + + +com.github.hisahi.tiralabradesaes.blockmodes Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package com.github.hisahi.tiralabradesaes.blockmodes

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherAES.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherAES.html new file mode 100644 index 0000000..5b62f50 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherAES.html @@ -0,0 +1,410 @@ + + + + + +CipherAES (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ciphers
+

Class CipherAES

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IBlockCipher
    +
    +
    +
    +
    public class CipherAES
    +extends java.lang.Object
    +implements IBlockCipher
    +
    Implements AES with three possible key sizes: 128 bits, + 192 bits and 256 bits.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CipherAES() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finish encryption or decryption.
      +
      intgetBlockSizeInBytes() +
      Gets the block size of the cipher in bytes.
      +
      voidinitDecrypt(byte[] key) +
      Initializes the block cipher for decryption.
      +
      voidinitEncrypt(byte[] key) +
      Initializes the block cipher for encryption.
      +
      booleanisValidKeySize(int bytes) +
      Checks whether the given key size is valid.
      +
      byte[]process(byte[] block) +
      Encrypts or decrypts a single block of data.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CipherAES

        +
        public CipherAES()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBlockSizeInBytes

        +
        public int getBlockSizeInBytes()
        +
        Description copied from interface: IBlockCipher
        +
        Gets the block size of the cipher in bytes.
        +
        +
        Specified by:
        +
        getBlockSizeInBytes in interface IBlockCipher
        +
        Returns:
        +
        The size of the cipher block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        isValidKeySize

        +
        public boolean isValidKeySize(int bytes)
        +
        Description copied from interface: IBlockCipher
        +
        Checks whether the given key size is valid.
        +
        +
        Specified by:
        +
        isValidKeySize in interface IBlockCipher
        +
        Parameters:
        +
        bytes - The proposed size of the key in bytes,
        +
        Returns:
        +
        Whether a key with the zize matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        public void initEncrypt(byte[] key)
        +
        Description copied from interface: IBlockCipher
        +
        Initializes the block cipher for encryption. To be called + before either process() or finish(). Calling initEncrypt() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        initEncrypt in interface IBlockCipher
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        public void initDecrypt(byte[] key)
        +
        Description copied from interface: IBlockCipher
        +
        Initializes the block cipher for decryption. To be called + before either process() or finish(). Calling initDecrypt() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        initDecrypt in interface IBlockCipher
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] block)
        +
        Description copied from interface: IBlockCipher
        +
        Encrypts or decrypts a single block of data. Note that the + given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IBlockCipher
        +
        Parameters:
        +
        block - The block of data to encrypt or decrypt.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IBlockCipher
        +
        Finish encryption or decryption. The cipher should be able + to be initialized again after finish() has been called.
        +
        +
        Specified by:
        +
        finish in interface IBlockCipher
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherChaCha20.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherChaCha20.html new file mode 100644 index 0000000..fa977d1 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherChaCha20.html @@ -0,0 +1,365 @@ + + + + + +CipherChaCha20 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ciphers
+

Class CipherChaCha20

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IStreamCipher
    +
    +
    +
    +
    public class CipherChaCha20
    +extends java.lang.Object
    +implements IStreamCipher
    +
    Implements the ChaCha20 stream cipher.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CipherChaCha20() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finish processing.
      +
      voidinit(byte[] key, + byte[] nonce) +
      Initializes the given stream cipher.
      +
      booleanisValidKeySize(int bytes) +
      Checks whether the given key size is valid.
      +
      byte[]process(byte[] block) +
      Encrypts or decrypts any amount of data given.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CipherChaCha20

        +
        public CipherChaCha20()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValidKeySize

        +
        public boolean isValidKeySize(int bytes)
        +
        Description copied from interface: IStreamCipher
        +
        Checks whether the given key size is valid.
        +
        +
        Specified by:
        +
        isValidKeySize in interface IStreamCipher
        +
        Parameters:
        +
        bytes - The proposed size of the key in bytes,
        +
        Returns:
        +
        Whether a key with the zize matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        init

        +
        public void init(byte[] key,
        +                 byte[] nonce)
        +
        Description copied from interface: IStreamCipher
        +
        Initializes the given stream cipher. To be called + before either process() or finish(). Calling init() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        init in interface IStreamCipher
        +
        Parameters:
        +
        key - The key to initialize with.
        +
        nonce - A nonce value, designed to be only used once + per initialization.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] block)
        +
        Description copied from interface: IStreamCipher
        +
        Encrypts or decrypts any amount of data given. Note that the + given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IStreamCipher
        +
        Parameters:
        +
        block - The data to encrypt or decrypt.
        +
        Returns:
        +
        The encrypted or decrypted data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IStreamCipher
        +
        Finish processing. The cipher should be able to be initialized + again after finish() has been called.
        +
        +
        Specified by:
        +
        finish in interface IStreamCipher
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherDES.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherDES.html new file mode 100644 index 0000000..0a2b492 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherDES.html @@ -0,0 +1,409 @@ + + + + + +CipherDES (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ciphers
+

Class CipherDES

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IBlockCipher
    +
    +
    +
    +
    public class CipherDES
    +extends java.lang.Object
    +implements IBlockCipher
    +
    Implements DES with 64-bit keys (with 56 bits of security).
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CipherDES() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finish encryption or decryption.
      +
      intgetBlockSizeInBytes() +
      Gets the block size of the cipher in bytes.
      +
      voidinitDecrypt(byte[] key) +
      Initializes the block cipher for decryption.
      +
      voidinitEncrypt(byte[] key) +
      Initializes the block cipher for encryption.
      +
      booleanisValidKeySize(int bytes) +
      Checks whether the given key size is valid.
      +
      byte[]process(byte[] block) +
      Encrypts or decrypts a single block of data.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CipherDES

        +
        public CipherDES()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBlockSizeInBytes

        +
        public int getBlockSizeInBytes()
        +
        Description copied from interface: IBlockCipher
        +
        Gets the block size of the cipher in bytes.
        +
        +
        Specified by:
        +
        getBlockSizeInBytes in interface IBlockCipher
        +
        Returns:
        +
        The size of the cipher block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        isValidKeySize

        +
        public boolean isValidKeySize(int bytes)
        +
        Description copied from interface: IBlockCipher
        +
        Checks whether the given key size is valid.
        +
        +
        Specified by:
        +
        isValidKeySize in interface IBlockCipher
        +
        Parameters:
        +
        bytes - The proposed size of the key in bytes,
        +
        Returns:
        +
        Whether a key with the zize matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        public void initEncrypt(byte[] key)
        +
        Description copied from interface: IBlockCipher
        +
        Initializes the block cipher for encryption. To be called + before either process() or finish(). Calling initEncrypt() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        initEncrypt in interface IBlockCipher
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        public void initDecrypt(byte[] key)
        +
        Description copied from interface: IBlockCipher
        +
        Initializes the block cipher for decryption. To be called + before either process() or finish(). Calling initDecrypt() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        initDecrypt in interface IBlockCipher
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IBlockCipher
        +
        Finish encryption or decryption. The cipher should be able + to be initialized again after finish() has been called.
        +
        +
        Specified by:
        +
        finish in interface IBlockCipher
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] block)
        +
        Description copied from interface: IBlockCipher
        +
        Encrypts or decrypts a single block of data. Note that the + given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IBlockCipher
        +
        Parameters:
        +
        block - The block of data to encrypt or decrypt.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherTripleDES.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherTripleDES.html new file mode 100644 index 0000000..6dc2547 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/CipherTripleDES.html @@ -0,0 +1,411 @@ + + + + + +CipherTripleDES (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ciphers
+

Class CipherTripleDES

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IBlockCipher
    +
    +
    +
    +
    public class CipherTripleDES
    +extends java.lang.Object
    +implements IBlockCipher
    +
    Implements 3DES-3TDEA, with three DES encryptions with three separate keys. + Each key is 64 bits (56 bits of security), which means 3DES expects + 192-bit (with 168 bits of security) keys.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CipherTripleDES() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finish encryption or decryption.
      +
      intgetBlockSizeInBytes() +
      Gets the block size of the cipher in bytes.
      +
      voidinitDecrypt(byte[] key) +
      Initializes the block cipher for decryption.
      +
      voidinitEncrypt(byte[] key) +
      Initializes the block cipher for encryption.
      +
      booleanisValidKeySize(int bytes) +
      Checks whether the given key size is valid.
      +
      byte[]process(byte[] block) +
      Encrypts or decrypts a single block of data.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CipherTripleDES

        +
        public CipherTripleDES()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBlockSizeInBytes

        +
        public int getBlockSizeInBytes()
        +
        Description copied from interface: IBlockCipher
        +
        Gets the block size of the cipher in bytes.
        +
        +
        Specified by:
        +
        getBlockSizeInBytes in interface IBlockCipher
        +
        Returns:
        +
        The size of the cipher block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        isValidKeySize

        +
        public boolean isValidKeySize(int bytes)
        +
        Description copied from interface: IBlockCipher
        +
        Checks whether the given key size is valid.
        +
        +
        Specified by:
        +
        isValidKeySize in interface IBlockCipher
        +
        Parameters:
        +
        bytes - The proposed size of the key in bytes,
        +
        Returns:
        +
        Whether a key with the zize matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        public void initEncrypt(byte[] key)
        +
        Description copied from interface: IBlockCipher
        +
        Initializes the block cipher for encryption. To be called + before either process() or finish(). Calling initEncrypt() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        initEncrypt in interface IBlockCipher
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        public void initDecrypt(byte[] key)
        +
        Description copied from interface: IBlockCipher
        +
        Initializes the block cipher for decryption. To be called + before either process() or finish(). Calling initDecrypt() + after initialization and before finishing is invalid.
        +
        +
        Specified by:
        +
        initDecrypt in interface IBlockCipher
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        public byte[] process(byte[] block)
        +
        Description copied from interface: IBlockCipher
        +
        Encrypts or decrypts a single block of data. Note that the + given byte array might be modified by the implementation.
        +
        +
        Specified by:
        +
        process in interface IBlockCipher
        +
        Parameters:
        +
        block - The block of data to encrypt or decrypt.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        public void finish()
        +
        Description copied from interface: IBlockCipher
        +
        Finish encryption or decryption. The cipher should be able + to be initialized again after finish() has been called.
        +
        +
        Specified by:
        +
        finish in interface IBlockCipher
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IBlockCipher.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IBlockCipher.html new file mode 100644 index 0000000..59766d6 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IBlockCipher.html @@ -0,0 +1,339 @@ + + + + + +IBlockCipher (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ciphers
+

Interface IBlockCipher

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    CipherAES, CipherDES, CipherTripleDES
    +
    +
    +
    +
    public interface IBlockCipher
    +
    Interface for block ciphers. Block ciphers are not meant to be used + directly but via a block mode implementing the IBlockMode interface.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finish encryption or decryption.
      +
      intgetBlockSizeInBytes() +
      Gets the block size of the cipher in bytes.
      +
      voidinitDecrypt(byte[] key) +
      Initializes the block cipher for decryption.
      +
      voidinitEncrypt(byte[] key) +
      Initializes the block cipher for encryption.
      +
      booleanisValidKeySize(int bytes) +
      Checks whether the given key size is valid.
      +
      byte[]process(byte[] block) +
      Encrypts or decrypts a single block of data.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBlockSizeInBytes

        +
        int getBlockSizeInBytes()
        +
        Gets the block size of the cipher in bytes.
        +
        +
        Returns:
        +
        The size of the cipher block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        isValidKeySize

        +
        boolean isValidKeySize(int bytes)
        +
        Checks whether the given key size is valid.
        +
        +
        Parameters:
        +
        bytes - The proposed size of the key in bytes,
        +
        Returns:
        +
        Whether a key with the zize matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        initEncrypt

        +
        void initEncrypt(byte[] key)
        +
        Initializes the block cipher for encryption. To be called + before either process() or finish(). Calling initEncrypt() + after initialization and before finishing is invalid.
        +
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        initDecrypt

        +
        void initDecrypt(byte[] key)
        +
        Initializes the block cipher for decryption. To be called + before either process() or finish(). Calling initDecrypt() + after initialization and before finishing is invalid.
        +
        +
        Parameters:
        +
        key - The key represented as a byte array. May not be null.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        byte[] process(byte[] block)
        +
        Encrypts or decrypts a single block of data. Note that the + given byte array might be modified by the implementation.
        +
        +
        Parameters:
        +
        block - The block of data to encrypt or decrypt.
        +
        Returns:
        +
        The encrypted or decrypted block of data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        void finish()
        +
        Finish encryption or decryption. The cipher should be able + to be initialized again after finish() has been called.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IStreamCipher.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IStreamCipher.html new file mode 100644 index 0000000..89c2a1b --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/IStreamCipher.html @@ -0,0 +1,300 @@ + + + + + +IStreamCipher (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ciphers
+

Interface IStreamCipher

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    CipherChaCha20
    +
    +
    +
    +
    public interface IStreamCipher
    +
    Interface for symmetric stream ciphers.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidfinish() +
      Finish processing.
      +
      voidinit(byte[] key, + byte[] nonce) +
      Initializes the given stream cipher.
      +
      booleanisValidKeySize(int bytes) +
      Checks whether the given key size is valid.
      +
      byte[]process(byte[] block) +
      Encrypts or decrypts any amount of data given.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValidKeySize

        +
        boolean isValidKeySize(int bytes)
        +
        Checks whether the given key size is valid.
        +
        +
        Parameters:
        +
        bytes - The proposed size of the key in bytes,
        +
        Returns:
        +
        Whether a key with the zize matching the given number of bytes + is valid.
        +
        +
      • +
      + + + +
        +
      • +

        init

        +
        void init(byte[] key,
        +          byte[] nonce)
        +
        Initializes the given stream cipher. To be called + before either process() or finish(). Calling init() + after initialization and before finishing is invalid.
        +
        +
        Parameters:
        +
        key - The key to initialize with.
        +
        nonce - A nonce value, designed to be only used once + per initialization.
        +
        +
      • +
      + + + +
        +
      • +

        process

        +
        byte[] process(byte[] block)
        +
        Encrypts or decrypts any amount of data given. Note that the + given byte array might be modified by the implementation.
        +
        +
        Parameters:
        +
        block - The data to encrypt or decrypt.
        +
        Returns:
        +
        The encrypted or decrypted data.
        +
        +
      • +
      + + + +
        +
      • +

        finish

        +
        void finish()
        +
        Finish processing. The cipher should be able to be initialized + again after finish() has been called.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-frame.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-frame.html new file mode 100644 index 0000000..e54ed85 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-frame.html @@ -0,0 +1,28 @@ + + + + + +com.github.hisahi.tiralabradesaes.ciphers (kryptoa API) + + + + + +

com.github.hisahi.tiralabradesaes.ciphers

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-summary.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-summary.html new file mode 100644 index 0000000..3c84e23 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-summary.html @@ -0,0 +1,195 @@ + + + + + +com.github.hisahi.tiralabradesaes.ciphers (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Package com.github.hisahi.tiralabradesaes.ciphers

+
+
Package containing the cryptographic cipher interface as well as + three implementations of it: DES, 3DES and AES.
+
+

See: Description

+
+
+ + + + +

Package com.github.hisahi.tiralabradesaes.ciphers Description

+
Package containing the cryptographic cipher interface as well as + three implementations of it: DES, 3DES and AES.
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-tree.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-tree.html new file mode 100644 index 0000000..62bfa61 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ciphers/package-tree.html @@ -0,0 +1,143 @@ + + + + + +com.github.hisahi.tiralabradesaes.ciphers Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package com.github.hisahi.tiralabradesaes.ciphers

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA1.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA1.html new file mode 100644 index 0000000..faba42d --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA1.html @@ -0,0 +1,355 @@ + + + + + +HashSHA1 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.hash
+

Class HashSHA1

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IHashFunction
    +
    +
    +
    +
    public class HashSHA1
    +extends java.lang.Object
    +implements IHashFunction
    +
    Implements SHA-1, or Secure Hash Algorithm 1.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HashSHA1() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]computeHash(byte[] data) +
      Computes a hash of the given byte array.
      +
      intgetBlockSize() +
      Gets the block size used by the hash function.
      +
      intgetHashLength() +
      Gets the size of the hash computed by the hash function.
      +
      voidreset() +
      Resets internal variables.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HashSHA1

        +
        public HashSHA1()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHashLength

        +
        public int getHashLength()
        +
        Description copied from interface: IHashFunction
        +
        Gets the size of the hash computed by the hash function.
        +
        +
        Specified by:
        +
        getHashLength in interface IHashFunction
        +
        Returns:
        +
        The size of the hash in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        getBlockSize

        +
        public int getBlockSize()
        +
        Description copied from interface: IHashFunction
        +
        Gets the block size used by the hash function.
        +
        +
        Specified by:
        +
        getBlockSize in interface IHashFunction
        +
        Returns:
        +
        The size of the block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        computeHash

        +
        public byte[] computeHash(byte[] data)
        +
        Description copied from interface: IHashFunction
        +
        Computes a hash of the given byte array.
        +
        +
        Specified by:
        +
        computeHash in interface IHashFunction
        +
        Parameters:
        +
        data - The data to hash.
        +
        Returns:
        +
        The resulting hash as a byte array.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Description copied from interface: IHashFunction
        +
        Resets internal variables. Recommended to be called when + no more hashes need to be computed in a given function.
        +
        +
        Specified by:
        +
        reset in interface IHashFunction
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_224.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_224.html new file mode 100644 index 0000000..637fa22 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_224.html @@ -0,0 +1,415 @@ + + + + + +HashSHA2_224 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.hash
+

Class HashSHA2_224

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IHashFunction
    +
    +
    +
    +
    public class HashSHA2_224
    +extends HashSHA2_256
    +
    Implements SHA-224, the version of SHA-2 that creates 224-bit hashes.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected byte[]resHash 
      + +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HashSHA2_224() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]computeHash(byte[] data) +
      Computes a hash of the given byte array.
      +
      intgetBlockSize() +
      Gets the block size used by the hash function.
      +
      intgetHashLength() +
      Gets the size of the hash computed by the hash function.
      +
      protected voidinitHn() +
      Initializes the constants H0..H7.
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        resHash

        +
        protected byte[] resHash
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HashSHA2_224

        +
        public HashSHA2_224()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        initHn

        +
        protected void initHn()
        +
        Description copied from class: HashSHA2_256
        +
        Initializes the constants H0..H7. Not intended to be + used directly but through computeHash() or an implementation of such.
        +
        +
        Overrides:
        +
        initHn in class HashSHA2_256
        +
        +
      • +
      + + + +
        +
      • +

        computeHash

        +
        public byte[] computeHash(byte[] data)
        +
        Description copied from interface: IHashFunction
        +
        Computes a hash of the given byte array.
        +
        +
        Specified by:
        +
        computeHash in interface IHashFunction
        +
        Overrides:
        +
        computeHash in class HashSHA2_256
        +
        Parameters:
        +
        data - The data to hash.
        +
        Returns:
        +
        The resulting hash as a byte array.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_256.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_256.html new file mode 100644 index 0000000..6c7d434 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_256.html @@ -0,0 +1,540 @@ + + + + + +HashSHA2_256 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.hash
+

Class HashSHA2_256

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IHashFunction
    +
    +
    +
    Direct Known Subclasses:
    +
    HashSHA2_224
    +
    +
    +
    +
    public class HashSHA2_256
    +extends java.lang.Object
    +implements IHashFunction
    +
    Implements SHA-256, the version of SHA-2 that creates 256-bit hashes.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected inth0 
      protected inth1 
      protected inth2 
      protected inth3 
      protected inth4 
      protected inth5 
      protected inth6 
      protected inth7 
      protected byte[]resHash +
      A byte array for the result hash.
      +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HashSHA2_256() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]computeHash(byte[] data) +
      Computes a hash of the given byte array.
      +
      protected voidcomputeHashInt(byte[] data) +
      Computes the actual SHA-2 hash values.
      +
      intgetBlockSize() +
      Gets the block size used by the hash function.
      +
      intgetHashLength() +
      Gets the size of the hash computed by the hash function.
      +
      protected voidinitHn() +
      Initializes the constants H0..H7.
      +
      voidreset() +
      Resets internal variables.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        h0

        +
        protected int h0
        +
      • +
      + + + +
        +
      • +

        h1

        +
        protected int h1
        +
      • +
      + + + +
        +
      • +

        h2

        +
        protected int h2
        +
      • +
      + + + +
        +
      • +

        h3

        +
        protected int h3
        +
      • +
      + + + +
        +
      • +

        h4

        +
        protected int h4
        +
      • +
      + + + +
        +
      • +

        h5

        +
        protected int h5
        +
      • +
      + + + +
        +
      • +

        h6

        +
        protected int h6
        +
      • +
      + + + +
        +
      • +

        h7

        +
        protected int h7
        +
      • +
      + + + +
        +
      • +

        resHash

        +
        protected byte[] resHash
        +
        A byte array for the result hash.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HashSHA2_256

        +
        public HashSHA2_256()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHashLength

        +
        public int getHashLength()
        +
        Description copied from interface: IHashFunction
        +
        Gets the size of the hash computed by the hash function.
        +
        +
        Specified by:
        +
        getHashLength in interface IHashFunction
        +
        Returns:
        +
        The size of the hash in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        getBlockSize

        +
        public int getBlockSize()
        +
        Description copied from interface: IHashFunction
        +
        Gets the block size used by the hash function.
        +
        +
        Specified by:
        +
        getBlockSize in interface IHashFunction
        +
        Returns:
        +
        The size of the block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        initHn

        +
        protected void initHn()
        +
        Initializes the constants H0..H7. Not intended to be + used directly but through computeHash() or an implementation of such.
        +
      • +
      + + + +
        +
      • +

        computeHashInt

        +
        protected void computeHashInt(byte[] data)
        +
        Computes the actual SHA-2 hash values. Not intended to be + used directly but through computeHash() or an implementation of such.
        +
        +
        Parameters:
        +
        data - The data to compute the hash for.
        +
        +
      • +
      + + + +
        +
      • +

        computeHash

        +
        public byte[] computeHash(byte[] data)
        +
        Description copied from interface: IHashFunction
        +
        Computes a hash of the given byte array.
        +
        +
        Specified by:
        +
        computeHash in interface IHashFunction
        +
        Parameters:
        +
        data - The data to hash.
        +
        Returns:
        +
        The resulting hash as a byte array.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Description copied from interface: IHashFunction
        +
        Resets internal variables. Recommended to be called when + no more hashes need to be computed in a given function.
        +
        +
        Specified by:
        +
        reset in interface IHashFunction
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_384.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_384.html new file mode 100644 index 0000000..6e698fd --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_384.html @@ -0,0 +1,415 @@ + + + + + +HashSHA2_384 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.hash
+

Class HashSHA2_384

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IHashFunction
    +
    +
    +
    +
    public class HashSHA2_384
    +extends HashSHA2_512
    +
    Implements SHA-384, the version of SHA-2 that creates 384-bit hashes.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected byte[]resHash 
      + +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HashSHA2_384() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]computeHash(byte[] data) +
      Computes a hash of the given byte array.
      +
      intgetBlockSize() +
      Gets the block size used by the hash function.
      +
      intgetHashLength() +
      Gets the size of the hash computed by the hash function.
      +
      protected voidinitHn() +
      Initializes the constants H0..H7.
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        resHash

        +
        protected byte[] resHash
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HashSHA2_384

        +
        public HashSHA2_384()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        initHn

        +
        protected void initHn()
        +
        Description copied from class: HashSHA2_512
        +
        Initializes the constants H0..H7. Not intended to be + used directly but through computeHash() or an implementation of such.
        +
        +
        Overrides:
        +
        initHn in class HashSHA2_512
        +
        +
      • +
      + + + +
        +
      • +

        computeHash

        +
        public byte[] computeHash(byte[] data)
        +
        Description copied from interface: IHashFunction
        +
        Computes a hash of the given byte array.
        +
        +
        Specified by:
        +
        computeHash in interface IHashFunction
        +
        Overrides:
        +
        computeHash in class HashSHA2_512
        +
        Parameters:
        +
        data - The data to hash.
        +
        Returns:
        +
        The resulting hash as a byte array.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_512.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_512.html new file mode 100644 index 0000000..cb57e4a --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/HashSHA2_512.html @@ -0,0 +1,540 @@ + + + + + +HashSHA2_512 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.hash
+

Class HashSHA2_512

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IHashFunction
    +
    +
    +
    Direct Known Subclasses:
    +
    HashSHA2_384
    +
    +
    +
    +
    public class HashSHA2_512
    +extends java.lang.Object
    +implements IHashFunction
    +
    Implements SHA-512, the version of SHA-2 that creates 512-bit hashes.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected longh0 
      protected longh1 
      protected longh2 
      protected longh3 
      protected longh4 
      protected longh5 
      protected longh6 
      protected longh7 
      protected byte[]resHash +
      A byte array for the result hash.
      +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HashSHA2_512() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]computeHash(byte[] data) +
      Computes a hash of the given byte array.
      +
      protected voidcomputeHashInt(byte[] data) +
      Computes the actual SHA-2 hash values.
      +
      intgetBlockSize() +
      Gets the block size used by the hash function.
      +
      intgetHashLength() +
      Gets the size of the hash computed by the hash function.
      +
      protected voidinitHn() +
      Initializes the constants H0..H7.
      +
      voidreset() +
      Resets internal variables.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        h0

        +
        protected long h0
        +
      • +
      + + + +
        +
      • +

        h1

        +
        protected long h1
        +
      • +
      + + + +
        +
      • +

        h2

        +
        protected long h2
        +
      • +
      + + + +
        +
      • +

        h3

        +
        protected long h3
        +
      • +
      + + + +
        +
      • +

        h4

        +
        protected long h4
        +
      • +
      + + + +
        +
      • +

        h5

        +
        protected long h5
        +
      • +
      + + + +
        +
      • +

        h6

        +
        protected long h6
        +
      • +
      + + + +
        +
      • +

        h7

        +
        protected long h7
        +
      • +
      + + + +
        +
      • +

        resHash

        +
        protected byte[] resHash
        +
        A byte array for the result hash.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HashSHA2_512

        +
        public HashSHA2_512()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHashLength

        +
        public int getHashLength()
        +
        Description copied from interface: IHashFunction
        +
        Gets the size of the hash computed by the hash function.
        +
        +
        Specified by:
        +
        getHashLength in interface IHashFunction
        +
        Returns:
        +
        The size of the hash in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        getBlockSize

        +
        public int getBlockSize()
        +
        Description copied from interface: IHashFunction
        +
        Gets the block size used by the hash function.
        +
        +
        Specified by:
        +
        getBlockSize in interface IHashFunction
        +
        Returns:
        +
        The size of the block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        initHn

        +
        protected void initHn()
        +
        Initializes the constants H0..H7. Not intended to be + used directly but through computeHash() or an implementation of such.
        +
      • +
      + + + +
        +
      • +

        computeHashInt

        +
        protected void computeHashInt(byte[] data)
        +
        Computes the actual SHA-2 hash values. Not intended to be + used directly but through computeHash() or an implementation of such.
        +
        +
        Parameters:
        +
        data - The data to compute the hash for.
        +
        +
      • +
      + + + +
        +
      • +

        computeHash

        +
        public byte[] computeHash(byte[] data)
        +
        Description copied from interface: IHashFunction
        +
        Computes a hash of the given byte array.
        +
        +
        Specified by:
        +
        computeHash in interface IHashFunction
        +
        Parameters:
        +
        data - The data to hash.
        +
        Returns:
        +
        The resulting hash as a byte array.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Description copied from interface: IHashFunction
        +
        Resets internal variables. Recommended to be called when + no more hashes need to be computed in a given function.
        +
        +
        Specified by:
        +
        reset in interface IHashFunction
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/IHashFunction.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/IHashFunction.html new file mode 100644 index 0000000..4f88b21 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/IHashFunction.html @@ -0,0 +1,290 @@ + + + + + +IHashFunction (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.hash
+

Interface IHashFunction

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      byte[]computeHash(byte[] data) +
      Computes a hash of the given byte array.
      +
      intgetBlockSize() +
      Gets the block size used by the hash function.
      +
      intgetHashLength() +
      Gets the size of the hash computed by the hash function.
      +
      voidreset() +
      Resets internal variables.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHashLength

        +
        int getHashLength()
        +
        Gets the size of the hash computed by the hash function.
        +
        +
        Returns:
        +
        The size of the hash in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        getBlockSize

        +
        int getBlockSize()
        +
        Gets the block size used by the hash function.
        +
        +
        Returns:
        +
        The size of the block in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        computeHash

        +
        byte[] computeHash(byte[] data)
        +
        Computes a hash of the given byte array.
        +
        +
        Parameters:
        +
        data - The data to hash.
        +
        Returns:
        +
        The resulting hash as a byte array.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        void reset()
        +
        Resets internal variables. Recommended to be called when + no more hashes need to be computed in a given function.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-frame.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-frame.html new file mode 100644 index 0000000..4aefce4 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-frame.html @@ -0,0 +1,28 @@ + + + + + +com.github.hisahi.tiralabradesaes.hash (kryptoa API) + + + + + +

com.github.hisahi.tiralabradesaes.hash

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-summary.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-summary.html new file mode 100644 index 0000000..cfea754 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-summary.html @@ -0,0 +1,194 @@ + + + + + +com.github.hisahi.tiralabradesaes.hash (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Package com.github.hisahi.tiralabradesaes.hash

+
+
Package containing the hash interface and 5 implementations for it: + SHA-1, SHA2-224, SHA2-256, SHA2-384 and SHA2-512.
+
+

See: Description

+
+
+ + + + +

Package com.github.hisahi.tiralabradesaes.hash Description

+
Package containing the hash interface and 5 implementations for it: + SHA-1, SHA2-224, SHA2-256, SHA2-384 and SHA2-512.
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-tree.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-tree.html new file mode 100644 index 0000000..0b18a3f --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/hash/package-tree.html @@ -0,0 +1,149 @@ + + + + + +com.github.hisahi.tiralabradesaes.hash Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package com.github.hisahi.tiralabradesaes.hash

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/HMACFunction.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/HMACFunction.html new file mode 100644 index 0000000..7fb3b46 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/HMACFunction.html @@ -0,0 +1,350 @@ + + + + + +HMACFunction (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.keyderiv
+

Class HMACFunction

+
+
+ +
+
    +
  • +
    +
    +
    public class HMACFunction
    +extends java.lang.Object
    +
    Implements a HMAC (hash-based message authentication code) function, + acting as a wrapper for an underlying hash function.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HMACFunction(IHashFunction hash) +
      Initializes a HMACFunction for the given hash function.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      byte[]computeHmac(byte[] key, + byte[] message) +
      Computes the HMAC for the given key and message.
      +
      intgetBlockSize() +
      Returns the block size of the underlying hash algorithm.
      +
      intgetHashLength() +
      Returns the length of the resulting HMAC in bytes.
      +
      voidreset() +
      Resets internal variables, recommended to be called after no more + HMACs need to be computed within a given function to improve security.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HMACFunction

        +
        public HMACFunction(IHashFunction hash)
        +
        Initializes a HMACFunction for the given hash function.
        +
        +
        Parameters:
        +
        hash - The hash function to be used to compute the HMAC.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHashLength

        +
        public int getHashLength()
        +
        Returns the length of the resulting HMAC in bytes.
        +
        +
        Returns:
        +
        The length of the result of the HMAC in bytes; same as the + length of the hash of the underlying hash function.
        +
        +
      • +
      + + + +
        +
      • +

        getBlockSize

        +
        public int getBlockSize()
        +
        Returns the block size of the underlying hash algorithm.
        +
        +
        Returns:
        +
        The block size in bytes.
        +
        +
      • +
      + + + +
        +
      • +

        computeHmac

        +
        public byte[] computeHmac(byte[] key,
        +                          byte[] message)
        +
        Computes the HMAC for the given key and message.
        +
        +
        Parameters:
        +
        key - The key used to compute the HMAC.
        +
        message - The message used to compute the HMAC.
        +
        Returns:
        +
        The resulting HMAC.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets internal variables, recommended to be called after no more + HMACs need to be computed within a given function to improve security. + Also calls the reset() method of the underlying hash algorithm.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/IKeyDerivation.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/IKeyDerivation.html new file mode 100644 index 0000000..3edd35b --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/IKeyDerivation.html @@ -0,0 +1,313 @@ + + + + + +IKeyDerivation (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.keyderiv
+

Interface IKeyDerivation

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    KeyDerivPBKDF2
    +
    +
    +
    +
    public interface IKeyDerivation
    +
    Describes a key derivation function that creates a key from a passphrase + and salt.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidcalibrateTime(int ms, + int keySize) +
      Calibrates the given key derivation function to take approximately + ms milliseconds for every generated key assuming a salt size equal to + the block size of the underlying hash function and a key size equal to + the given parameter.
      +
      voidderiveKey(byte[] key, + byte[] password, + byte[] salt) +
      Derives a key from the given password and salt and + places it into the given byte array.
      +
      longgetCost() +
      Gets the current cost of the key-derivation function.
      +
      voidsetCost(long c) +
      Sets the cost used by this key derivation function.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        deriveKey

        +
        void deriveKey(byte[] key,
        +               byte[] password,
        +               byte[] salt)
        +
        Derives a key from the given password and salt and + places it into the given byte array.
        +
        +
        Parameters:
        +
        key - The output byte array where the derived key will be stored.
        +
        password - The passphrase to use when deriving the key.
        +
        salt - The salt to use when deriving the key.
        +
        +
      • +
      + + + +
        +
      • +

        getCost

        +
        long getCost()
        +
        Gets the current cost of the key-derivation function. The value + should be a positive number, or 0 if the cost value is irrelevant + for this key derivation function.
        +
        +
        Returns:
        +
        The current cost value.
        +
        +
      • +
      + + + +
        +
      • +

        setCost

        +
        void setCost(long c)
        +
        Sets the cost used by this key derivation function.
        +
        +
        Parameters:
        +
        c - The cost value; higher values take longer but have better + security against brute-force attacks.
        +
        +
      • +
      + + + +
        +
      • +

        calibrateTime

        +
        void calibrateTime(int ms,
        +                   int keySize)
        +
        Calibrates the given key derivation function to take approximately + ms milliseconds for every generated key assuming a salt size equal to + the block size of the underlying hash function and a key size equal to + the given parameter. The cost of the key derivation is adjusted + accordingly.
        +
        +
        Parameters:
        +
        ms - The milliseconds to approximately take for every key.
        +
        keySize - The size of the key to calibrate for.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/KeyDerivPBKDF2.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/KeyDerivPBKDF2.html new file mode 100644 index 0000000..4c116dd --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/KeyDerivPBKDF2.html @@ -0,0 +1,391 @@ + + + + + +KeyDerivPBKDF2 (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.keyderiv
+

Class KeyDerivPBKDF2

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IKeyDerivation
    +
    +
    +
    +
    public class KeyDerivPBKDF2
    +extends java.lang.Object
    +implements IKeyDerivation
    +
    Implements PBKDF2 (Password-Based Key Derivation Function 2), a key + derivation function that takes in a passphrase and salt and turns + them into a cryptographic key.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      KeyDerivPBKDF2(HMACFunction prf, + long c) +
      Creates a KeyDerivPBKDF2 instance from the given HMAC function + and a cost value.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidcalibrateTime(int ms, + int keySize) +
      Calibrates the given key derivation function to take approximately + ms milliseconds for every generated key assuming a salt size equal to + the block size of the underlying hash function and a key size equal to + the given parameter.
      +
      voidderiveKey(byte[] key, + byte[] password, + byte[] salt) +
      Derives a key from the given password and salt and + places it into the given byte array.
      +
      longgetCost() +
      Gets the current cost of the key-derivation function.
      +
      voidsetCost(long c) +
      Sets the cost used by this key derivation function.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        KeyDerivPBKDF2

        +
        public KeyDerivPBKDF2(HMACFunction prf,
        +                      long c)
        +
        Creates a KeyDerivPBKDF2 instance from the given HMAC function + and a cost value. The cost value controls the number of iterations + and increases the amount of time it takes to derive a key.
        +
        +
        Parameters:
        +
        prf - The HMAC function to be used to derive the key.
        +
        c - The cost value; higher values take longer but have better + security against brute-force attacks.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCost

        +
        public long getCost()
        +
        Description copied from interface: IKeyDerivation
        +
        Gets the current cost of the key-derivation function. The value + should be a positive number, or 0 if the cost value is irrelevant + for this key derivation function.
        +
        +
        Specified by:
        +
        getCost in interface IKeyDerivation
        +
        Returns:
        +
        The current cost value.
        +
        +
      • +
      + + + +
        +
      • +

        setCost

        +
        public void setCost(long c)
        +
        Description copied from interface: IKeyDerivation
        +
        Sets the cost used by this key derivation function.
        +
        +
        Specified by:
        +
        setCost in interface IKeyDerivation
        +
        Parameters:
        +
        c - The cost value; higher values take longer but have better + security against brute-force attacks.
        +
        +
      • +
      + + + +
        +
      • +

        calibrateTime

        +
        public void calibrateTime(int ms,
        +                          int keySize)
        +
        Description copied from interface: IKeyDerivation
        +
        Calibrates the given key derivation function to take approximately + ms milliseconds for every generated key assuming a salt size equal to + the block size of the underlying hash function and a key size equal to + the given parameter. The cost of the key derivation is adjusted + accordingly.
        +
        +
        Specified by:
        +
        calibrateTime in interface IKeyDerivation
        +
        Parameters:
        +
        ms - The milliseconds to approximately take for every key.
        +
        keySize - The size of the key to calibrate for.
        +
        +
      • +
      + + + +
        +
      • +

        deriveKey

        +
        public void deriveKey(byte[] key,
        +                      byte[] password,
        +                      byte[] salt)
        +
        Description copied from interface: IKeyDerivation
        +
        Derives a key from the given password and salt and + places it into the given byte array.
        +
        +
        Specified by:
        +
        deriveKey in interface IKeyDerivation
        +
        Parameters:
        +
        key - The output byte array where the derived key will be stored.
        +
        password - The passphrase to use when deriving the key.
        +
        salt - The salt to use when deriving the key.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-frame.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-frame.html new file mode 100644 index 0000000..ca61307 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-frame.html @@ -0,0 +1,25 @@ + + + + + +com.github.hisahi.tiralabradesaes.keyderiv (kryptoa API) + + + + + +

com.github.hisahi.tiralabradesaes.keyderiv

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-summary.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-summary.html new file mode 100644 index 0000000..324b77c --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-summary.html @@ -0,0 +1,180 @@ + + + + + +com.github.hisahi.tiralabradesaes.keyderiv (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Package com.github.hisahi.tiralabradesaes.keyderiv

+
+
Package containing the key derivation function interface and an + implementation of PBKDF2 as well as HMAC used by PBKDF2.
+
+

See: Description

+
+
+ + + + +

Package com.github.hisahi.tiralabradesaes.keyderiv Description

+
Package containing the key derivation function interface and an + implementation of PBKDF2 as well as HMAC used by PBKDF2.
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-tree.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-tree.html new file mode 100644 index 0000000..2149137 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/keyderiv/package-tree.html @@ -0,0 +1,140 @@ + + + + + +com.github.hisahi.tiralabradesaes.keyderiv Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package com.github.hisahi.tiralabradesaes.keyderiv

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/package-frame.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/package-frame.html new file mode 100644 index 0000000..f87a7b1 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/package-frame.html @@ -0,0 +1,26 @@ + + + + + +com.github.hisahi.tiralabradesaes (kryptoa API) + + + + + +

com.github.hisahi.tiralabradesaes

+
+

Classes

+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/package-summary.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/package-summary.html new file mode 100644 index 0000000..5c05ea1 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/package-summary.html @@ -0,0 +1,193 @@ + + + + + +com.github.hisahi.tiralabradesaes (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Package com.github.hisahi.tiralabradesaes

+
+
The main package for the program, containing assorted classes, such as + utilities and padding code.
+
+

See: Description

+
+
+ + + + +

Package com.github.hisahi.tiralabradesaes Description

+
The main package for the program, containing assorted classes, such as + utilities and padding code.
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/package-tree.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/package-tree.html new file mode 100644 index 0000000..2c9b9c8 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/package-tree.html @@ -0,0 +1,145 @@ + + + + + +com.github.hisahi.tiralabradesaes Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package com.github.hisahi.tiralabradesaes

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/TestMain.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/TestMain.html new file mode 100644 index 0000000..1d8df00 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/TestMain.html @@ -0,0 +1,305 @@ + + + + + +TestMain (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ui
+

Class TestMain

+
+
+ +
+
    +
  • +
    +
    +
    public class TestMain
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TestMain() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static booleanconfirmPrompt(java.lang.String msg) 
      static intmain_ret(java.lang.String[] args) 
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TestMain

        +
        public TestMain()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +                 throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        main_ret

        +
        public static int main_ret(java.lang.String[] args)
        +                    throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        confirmPrompt

        +
        public static boolean confirmPrompt(java.lang.String msg)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/VoidOutputStream.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/VoidOutputStream.html new file mode 100644 index 0000000..7b3f871 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/VoidOutputStream.html @@ -0,0 +1,294 @@ + + + + + +VoidOutputStream (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.github.hisahi.tiralabradesaes.ui
+

Class VoidOutputStream

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
    +
    +
    +
    +
    public class VoidOutputStream
    +extends java.io.OutputStream
    +
    An OutputStream that writes nowhere. It moves all bits to the + hundred-and-twenty-seventh section of the bit space.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      VoidOutputStream() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidwrite(int b) 
      +
        +
      • + + +

        Methods inherited from class java.io.OutputStream

        +close, flush, write, write
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        VoidOutputStream

        +
        public VoidOutputStream()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        write

        +
        public void write(int b)
        +           throws java.io.IOException
        +
        +
        Specified by:
        +
        write in class java.io.OutputStream
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-frame.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-frame.html new file mode 100644 index 0000000..b5c1e04 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-frame.html @@ -0,0 +1,20 @@ + + + + + +com.github.hisahi.tiralabradesaes.ui (kryptoa API) + + + + + +

com.github.hisahi.tiralabradesaes.ui

+
+

Classes

+ +
+ + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-summary.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-summary.html new file mode 100644 index 0000000..689c4ce --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-summary.html @@ -0,0 +1,151 @@ + + + + + +com.github.hisahi.tiralabradesaes.ui (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Package com.github.hisahi.tiralabradesaes.ui

+
+
Package containing the program interface code, including code for the + command line program.
+
+

See: Description

+
+
+ + + + +

Package com.github.hisahi.tiralabradesaes.ui Description

+
Package containing the program interface code, including code for the + command line program.
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-tree.html b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-tree.html new file mode 100644 index 0000000..fd30e22 --- /dev/null +++ b/doc/javadoc/com/github/hisahi/tiralabradesaes/ui/package-tree.html @@ -0,0 +1,135 @@ + + + + + +com.github.hisahi.tiralabradesaes.ui Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package com.github.hisahi.tiralabradesaes.ui

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/constant-values.html b/doc/javadoc/constant-values.html new file mode 100644 index 0000000..5649648 --- /dev/null +++ b/doc/javadoc/constant-values.html @@ -0,0 +1,122 @@ + + + + + +Constant Field Values (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/deprecated-list.html b/doc/javadoc/deprecated-list.html new file mode 100644 index 0000000..27aabaf --- /dev/null +++ b/doc/javadoc/deprecated-list.html @@ -0,0 +1,122 @@ + + + + + +Deprecated List (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/help-doc.html b/doc/javadoc/help-doc.html new file mode 100644 index 0000000..794550c --- /dev/null +++ b/doc/javadoc/help-doc.html @@ -0,0 +1,223 @@ + + + + + +API Help (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/index-all.html b/doc/javadoc/index-all.html new file mode 100644 index 0000000..5345839 --- /dev/null +++ b/doc/javadoc/index-all.html @@ -0,0 +1,825 @@ + + + + + +Index (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
B C D F G H I K M N P R S T U V W  + + +

B

+
+
Base64OutputStream - Class in com.github.hisahi.tiralabradesaes
+
+
An output stream that writes the bytes encoded as Base64 into the + underlying PrintStream.
+
+
Base64OutputStream(PrintStream) - Constructor for class com.github.hisahi.tiralabradesaes.Base64OutputStream
+
 
+
BlockModeCBC - Class in com.github.hisahi.tiralabradesaes.blockmodes
+
+
Implements the CBC, or Cipher Block Chaining, block mode of operation.
+
+
BlockModeCBC(IBlockCipher) - Constructor for class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCBC
+
+
Initializes the CBC block mode with the cipher to call process() with.
+
+
BlockModeCTR - Class in com.github.hisahi.tiralabradesaes.blockmodes
+
+
Implements the CTR, or Counter, block mode of operation.
+
+
BlockModeCTR(IBlockCipher) - Constructor for class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCTR
+
+
Initializes the CTR block mode with the cipher to call process() with.
+
+
BlockModeECB - Class in com.github.hisahi.tiralabradesaes.blockmodes
+
+
Implements the ECB, or Electronic Code Book, block mode of operation.
+
+
BlockModeECB(IBlockCipher) - Constructor for class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeECB
+
+
Initializes the ECB block mode with the cipher to call process() with.
+
+
+ + + +

C

+
+
calibrateTime(int, int) - Method in interface com.github.hisahi.tiralabradesaes.keyderiv.IKeyDerivation
+
+
Calibrates the given key derivation function to take approximately + ms milliseconds for every generated key assuming a salt size equal to + the block size of the underlying hash function and a key size equal to + the given parameter.
+
+
calibrateTime(int, int) - Method in class com.github.hisahi.tiralabradesaes.keyderiv.KeyDerivPBKDF2
+
 
+
CipherAES - Class in com.github.hisahi.tiralabradesaes.ciphers
+
+
Implements AES with three possible key sizes: 128 bits, + 192 bits and 256 bits.
+
+
CipherAES() - Constructor for class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
CipherChaCha20 - Class in com.github.hisahi.tiralabradesaes.ciphers
+
+
Implements the ChaCha20 stream cipher.
+
+
CipherChaCha20() - Constructor for class com.github.hisahi.tiralabradesaes.ciphers.CipherChaCha20
+
 
+
CipherDES - Class in com.github.hisahi.tiralabradesaes.ciphers
+
+
Implements DES with 64-bit keys (with 56 bits of security).
+
+
CipherDES() - Constructor for class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
CipherTripleDES - Class in com.github.hisahi.tiralabradesaes.ciphers
+
+
Implements 3DES-3TDEA, with three DES encryptions with three separate keys.
+
+
CipherTripleDES() - Constructor for class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
close() - Method in class com.github.hisahi.tiralabradesaes.Base64OutputStream
+
 
+
close() - Method in class com.github.hisahi.tiralabradesaes.HexOutputStream
+
 
+
com.github.hisahi.tiralabradesaes - package com.github.hisahi.tiralabradesaes
+
+
The main package for the program, containing assorted classes, such as + utilities and padding code.
+
+
com.github.hisahi.tiralabradesaes.blockmodes - package com.github.hisahi.tiralabradesaes.blockmodes
+
+
Package containing the block cipher mode of operation interface + as well as three implementations for it: ECB, CBC and CTR.
+
+
com.github.hisahi.tiralabradesaes.ciphers - package com.github.hisahi.tiralabradesaes.ciphers
+
+
Package containing the cryptographic cipher interface as well as + three implementations of it: DES, 3DES and AES.
+
+
com.github.hisahi.tiralabradesaes.hash - package com.github.hisahi.tiralabradesaes.hash
+
+
Package containing the hash interface and 5 implementations for it: + SHA-1, SHA2-224, SHA2-256, SHA2-384 and SHA2-512.
+
+
com.github.hisahi.tiralabradesaes.keyderiv - package com.github.hisahi.tiralabradesaes.keyderiv
+
+
Package containing the key derivation function interface and an + implementation of PBKDF2 as well as HMAC used by PBKDF2.
+
+
com.github.hisahi.tiralabradesaes.ui - package com.github.hisahi.tiralabradesaes.ui
+
+
Package containing the program interface code, including code for the + command line program.
+
+
computeHash(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA1
+
 
+
computeHash(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_224
+
 
+
computeHash(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
computeHash(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_384
+
 
+
computeHash(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
computeHash(byte[]) - Method in interface com.github.hisahi.tiralabradesaes.hash.IHashFunction
+
+
Computes a hash of the given byte array.
+
+
computeHashInt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
+
Computes the actual SHA-2 hash values.
+
+
computeHashInt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
+
Computes the actual SHA-2 hash values.
+
+
computeHmac(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.keyderiv.HMACFunction
+
+
Computes the HMAC for the given key and message.
+
+
confirmPrompt(String) - Static method in class com.github.hisahi.tiralabradesaes.ui.TestMain
+
 
+
convertBase64ToBytes(String) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts the given Base64 string to a byte array.
+
+
convertBytesToHex(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts the given byte array into a hex string consisting of + two hex digits for each byte, not separated with spaces or anything + else.
+
+
convertHexToBytes(String) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts the given hex string to a byte array.
+
+
+ + + +

D

+
+
deriveKey(byte[], byte[], byte[]) - Method in interface com.github.hisahi.tiralabradesaes.keyderiv.IKeyDerivation
+
+
Derives a key from the given password and salt and + places it into the given byte array.
+
+
deriveKey(byte[], byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.keyderiv.KeyDerivPBKDF2
+
 
+
destroyArray(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Wipes the contents of the given byte[] array.
+
+
destroyArray(int[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Wipes the contents of the given int[] array.
+
+
dumpBlock(byte[], int) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Dumps the given byte array with the given length into the standard + output as hex.
+
+
+ + + +

F

+
+
feedBlock(byte[]) - Method in class com.github.hisahi.tiralabradesaes.PaddingRemoverWriter
+
+
Feeds a block of data with byteSize bytes into the stream.
+
+
finish() - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCBC
+
 
+
finish() - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCTR
+
 
+
finish() - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeECB
+
 
+
finish() - Method in interface com.github.hisahi.tiralabradesaes.blockmodes.IBlockMode
+
+
Finishes the block mode of operation, after which it has to be + initialized again for it to work.
+
+
finish() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
finish() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherChaCha20
+
 
+
finish() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
finish() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
finish() - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IBlockCipher
+
+
Finish encryption or decryption.
+
+
finish() - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IStreamCipher
+
+
Finish processing.
+
+
finish() - Method in class com.github.hisahi.tiralabradesaes.PaddingRemoverWriter
+
+
To be called when there are no more blocks to feed.
+
+
flush() - Method in class com.github.hisahi.tiralabradesaes.Base64OutputStream
+
 
+
flush() - Method in class com.github.hisahi.tiralabradesaes.HexOutputStream
+
 
+
+ + + +

G

+
+
generateStrongRandom(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Fills the given byte array with random bytes generated using a + cryptographically secure pseudo random number generator.
+
+
generateWeakRandom(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Fills the given byte array with random bytes NOT suitable for + cryptographic purposes.
+
+
getBlockSize() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA1
+
 
+
getBlockSize() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_224
+
 
+
getBlockSize() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
getBlockSize() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_384
+
 
+
getBlockSize() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
getBlockSize() - Method in interface com.github.hisahi.tiralabradesaes.hash.IHashFunction
+
+
Gets the block size used by the hash function.
+
+
getBlockSize() - Method in class com.github.hisahi.tiralabradesaes.keyderiv.HMACFunction
+
+
Returns the block size of the underlying hash algorithm.
+
+
getBlockSizeInBytes() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
getBlockSizeInBytes() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
getBlockSizeInBytes() - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
getBlockSizeInBytes() - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IBlockCipher
+
+
Gets the block size of the cipher in bytes.
+
+
getCost() - Method in interface com.github.hisahi.tiralabradesaes.keyderiv.IKeyDerivation
+
+
Gets the current cost of the key-derivation function.
+
+
getCost() - Method in class com.github.hisahi.tiralabradesaes.keyderiv.KeyDerivPBKDF2
+
 
+
getHashLength() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA1
+
 
+
getHashLength() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_224
+
 
+
getHashLength() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
getHashLength() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_384
+
 
+
getHashLength() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
getHashLength() - Method in interface com.github.hisahi.tiralabradesaes.hash.IHashFunction
+
+
Gets the size of the hash computed by the hash function.
+
+
getHashLength() - Method in class com.github.hisahi.tiralabradesaes.keyderiv.HMACFunction
+
+
Returns the length of the resulting HMAC in bytes.
+
+
+ + + +

H

+
+
h0 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h0 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h1 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h1 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h2 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h2 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h3 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h3 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h4 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h4 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h5 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h5 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h6 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h6 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
h7 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
h7 - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
HashSHA1 - Class in com.github.hisahi.tiralabradesaes.hash
+
+
Implements SHA-1, or Secure Hash Algorithm 1.
+
+
HashSHA1() - Constructor for class com.github.hisahi.tiralabradesaes.hash.HashSHA1
+
 
+
HashSHA2_224 - Class in com.github.hisahi.tiralabradesaes.hash
+
+
Implements SHA-224, the version of SHA-2 that creates 224-bit hashes.
+
+
HashSHA2_224() - Constructor for class com.github.hisahi.tiralabradesaes.hash.HashSHA2_224
+
 
+
HashSHA2_256 - Class in com.github.hisahi.tiralabradesaes.hash
+
+
Implements SHA-256, the version of SHA-2 that creates 256-bit hashes.
+
+
HashSHA2_256() - Constructor for class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
HashSHA2_384 - Class in com.github.hisahi.tiralabradesaes.hash
+
+
Implements SHA-384, the version of SHA-2 that creates 384-bit hashes.
+
+
HashSHA2_384() - Constructor for class com.github.hisahi.tiralabradesaes.hash.HashSHA2_384
+
 
+
HashSHA2_512 - Class in com.github.hisahi.tiralabradesaes.hash
+
+
Implements SHA-512, the version of SHA-2 that creates 512-bit hashes.
+
+
HashSHA2_512() - Constructor for class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
HexOutputStream - Class in com.github.hisahi.tiralabradesaes
+
+
An output stream that writes the bytes encoded as hexadecimal digits into + the underlying PrintStream.
+
+
HexOutputStream(PrintStream) - Constructor for class com.github.hisahi.tiralabradesaes.HexOutputStream
+
 
+
HMACFunction - Class in com.github.hisahi.tiralabradesaes.keyderiv
+
+
Implements a HMAC (hash-based message authentication code) function, + acting as a wrapper for an underlying hash function.
+
+
HMACFunction(IHashFunction) - Constructor for class com.github.hisahi.tiralabradesaes.keyderiv.HMACFunction
+
+
Initializes a HMACFunction for the given hash function.
+
+
+ + + +

I

+
+
IBlockCipher - Interface in com.github.hisahi.tiralabradesaes.ciphers
+
+
Interface for block ciphers.
+
+
IBlockMode - Interface in com.github.hisahi.tiralabradesaes.blockmodes
+
+
Interface for block cipher modes of operation.
+
+
IHashFunction - Interface in com.github.hisahi.tiralabradesaes.hash
+
+
Represents a hash function.
+
+
IKeyDerivation - Interface in com.github.hisahi.tiralabradesaes.keyderiv
+
+
Describes a key derivation function that creates a key from a passphrase + and salt.
+
+
init(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherChaCha20
+
 
+
init(byte[], byte[]) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IStreamCipher
+
+
Initializes the given stream cipher.
+
+
initDecrypt(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCBC
+
 
+
initDecrypt(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCTR
+
 
+
initDecrypt(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeECB
+
 
+
initDecrypt(byte[], byte[]) - Method in interface com.github.hisahi.tiralabradesaes.blockmodes.IBlockMode
+
+
Initializes the block cipher mode of operation for decrypting blocks.
+
+
initDecrypt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
initDecrypt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
initDecrypt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
initDecrypt(byte[]) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IBlockCipher
+
+
Initializes the block cipher for decryption.
+
+
initEncrypt(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCBC
+
 
+
initEncrypt(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCTR
+
 
+
initEncrypt(byte[], byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeECB
+
 
+
initEncrypt(byte[], byte[]) - Method in interface com.github.hisahi.tiralabradesaes.blockmodes.IBlockMode
+
+
Initializes the block cipher mode of operation for encrypting blocks.
+
+
initEncrypt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
initEncrypt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
initEncrypt(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
initEncrypt(byte[]) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IBlockCipher
+
+
Initializes the block cipher for encryption.
+
+
initHn() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_224
+
 
+
initHn() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
+
Initializes the constants H0..H7.
+
+
initHn() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_384
+
 
+
initHn() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
+
Initializes the constants H0..H7.
+
+
IStreamCipher - Interface in com.github.hisahi.tiralabradesaes.ciphers
+
+
Interface for symmetric stream ciphers.
+
+
isValidIVSize(int) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCBC
+
 
+
isValidIVSize(int) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCTR
+
 
+
isValidIVSize(int) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeECB
+
 
+
isValidIVSize(int) - Method in interface com.github.hisahi.tiralabradesaes.blockmodes.IBlockMode
+
+
Checks whether the given IV size is valid.
+
+
isValidKeySize(int) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
isValidKeySize(int) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherChaCha20
+
 
+
isValidKeySize(int) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
isValidKeySize(int) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
isValidKeySize(int) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IBlockCipher
+
+
Checks whether the given key size is valid.
+
+
isValidKeySize(int) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IStreamCipher
+
+
Checks whether the given key size is valid.
+
+
+ + + +

K

+
+
KeyDerivPBKDF2 - Class in com.github.hisahi.tiralabradesaes.keyderiv
+
+
Implements PBKDF2 (Password-Based Key Derivation Function 2), a key + derivation function that takes in a passphrase and salt and turns + them into a cryptographic key.
+
+
KeyDerivPBKDF2(HMACFunction, long) - Constructor for class com.github.hisahi.tiralabradesaes.keyderiv.KeyDerivPBKDF2
+
+
Creates a KeyDerivPBKDF2 instance from the given HMAC function + and a cost value.
+
+
+ + + +

M

+
+
main(String[]) - Static method in class com.github.hisahi.tiralabradesaes.ui.TestMain
+
 
+
main_ret(String[]) - Static method in class com.github.hisahi.tiralabradesaes.ui.TestMain
+
 
+
MT19937 - Class in com.github.hisahi.tiralabradesaes
+
+
A MT19937 (Mersenne Twister) random number generator.
+
+
MT19937() - Constructor for class com.github.hisahi.tiralabradesaes.MT19937
+
 
+
+ + + +

N

+
+
nextBlock() - Method in class com.github.hisahi.tiralabradesaes.StreamBlockReader
+
+
Reads the next block from the stream.
+
+
nextBytes(byte[]) - Method in class com.github.hisahi.tiralabradesaes.MT19937
+
+
Fills the given byte array with random bytes.
+
+
nextInt() - Method in class com.github.hisahi.tiralabradesaes.MT19937
+
+
Returns the next random number from the generator.
+
+
+ + + +

P

+
+
PaddingRemoverWriter - Class in com.github.hisahi.tiralabradesaes
+
+
A class that writes to an OutputStream, removing PKCS padding from the + blocks it has been given.
+
+
PaddingRemoverWriter(OutputStream, int) - Constructor for class com.github.hisahi.tiralabradesaes.PaddingRemoverWriter
+
+
Constructs a PaddingRemoverWriter instance from an OutputStream to + write to and block size in bytes.
+
+
prepare3DESKey(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts a 21-byte 168-bit 3DES key to the full 24-byte 192-bit 3DES key.
+
+
prepare3DESKeyFrom14Bytes(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts a 14-byte 112-bit 3DES key to the full 24-byte 192-bit 3DES key.
+
+
prepare3DESKeyFrom16Bytes(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts a 16-byte 128-bit 3DES key to the full 24-byte 192-bit 3DES key.
+
+
prepareDESKey(byte[]) - Static method in class com.github.hisahi.tiralabradesaes.Utils
+
+
Converts a 7-byte 56-bit DES key to the full 8-byte 64-bit DES key.
+
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCBC
+
 
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeCTR
+
 
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.blockmodes.BlockModeECB
+
 
+
process(byte[]) - Method in interface com.github.hisahi.tiralabradesaes.blockmodes.IBlockMode
+
+
Processes a single block of plaintext.
+
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherAES
+
 
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherChaCha20
+
 
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherDES
+
 
+
process(byte[]) - Method in class com.github.hisahi.tiralabradesaes.ciphers.CipherTripleDES
+
 
+
process(byte[]) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IBlockCipher
+
+
Encrypts or decrypts a single block of data.
+
+
process(byte[]) - Method in interface com.github.hisahi.tiralabradesaes.ciphers.IStreamCipher
+
+
Encrypts or decrypts any amount of data given.
+
+
+ + + +

R

+
+
reset() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA1
+
 
+
reset() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
 
+
reset() - Method in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
 
+
reset() - Method in interface com.github.hisahi.tiralabradesaes.hash.IHashFunction
+
+
Resets internal variables.
+
+
reset() - Method in class com.github.hisahi.tiralabradesaes.keyderiv.HMACFunction
+
+
Resets internal variables, recommended to be called after no more + HMACs need to be computed within a given function to improve security.
+
+
resHash - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_224
+
 
+
resHash - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_256
+
+
A byte array for the result hash.
+
+
resHash - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_384
+
 
+
resHash - Variable in class com.github.hisahi.tiralabradesaes.hash.HashSHA2_512
+
+
A byte array for the result hash.
+
+
+ + + +

S

+
+
setCost(long) - Method in interface com.github.hisahi.tiralabradesaes.keyderiv.IKeyDerivation
+
+
Sets the cost used by this key derivation function.
+
+
setCost(long) - Method in class com.github.hisahi.tiralabradesaes.keyderiv.KeyDerivPBKDF2
+
 
+
setSeed(int) - Method in class com.github.hisahi.tiralabradesaes.MT19937
+
+
Sets the new seed for the Mersenne Twister.
+
+
StreamBlockReader - Class in com.github.hisahi.tiralabradesaes
+
+
Represents a blocked version of InputStream that converts a stream into + blocks suitable for encryption and decryption with block ciphers.
+
+
StreamBlockReader(InputStream, int) - Constructor for class com.github.hisahi.tiralabradesaes.StreamBlockReader
+
+
Creates a new BlockInputStream from an existing InputStream and a size + of the block in bytes (* 8 for size in bits).
+
+
StreamBlockReader(InputStream, int, boolean) - Constructor for class com.github.hisahi.tiralabradesaes.StreamBlockReader
+
+
Creates a new BlockInputStream from an existing InputStream and a size + of the block in bytes (* 8 for size in bits).
+
+
+ + + +

T

+
+
TestMain - Class in com.github.hisahi.tiralabradesaes.ui
+
 
+
TestMain() - Constructor for class com.github.hisahi.tiralabradesaes.ui.TestMain
+
 
+
+ + + +

U

+
+
Utils - Class in com.github.hisahi.tiralabradesaes
+
+
Various utility functions to be used by other code.
+
+
+ + + +

V

+
+
VoidOutputStream - Class in com.github.hisahi.tiralabradesaes
+
+
An OutputStream that writes nowhere.
+
+
VoidOutputStream() - Constructor for class com.github.hisahi.tiralabradesaes.VoidOutputStream
+
 
+
+ + + +

W

+
+
write(int) - Method in class com.github.hisahi.tiralabradesaes.Base64OutputStream
+
 
+
write(int) - Method in class com.github.hisahi.tiralabradesaes.HexOutputStream
+
 
+
write(int) - Method in class com.github.hisahi.tiralabradesaes.VoidOutputStream
+
+
Does nothing.
+
+
+B C D F G H I K M N P R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/index.html b/doc/javadoc/index.html new file mode 100644 index 0000000..736f157 --- /dev/null +++ b/doc/javadoc/index.html @@ -0,0 +1,75 @@ + + + + + +kryptoa API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/doc/javadoc/overview-frame.html b/doc/javadoc/overview-frame.html new file mode 100644 index 0000000..58f2c99 --- /dev/null +++ b/doc/javadoc/overview-frame.html @@ -0,0 +1,26 @@ + + + + + +Overview List (kryptoa API) + + + + + +
All Classes
+
+

Packages

+ +
+

 

+ + diff --git a/doc/javadoc/overview-summary.html b/doc/javadoc/overview-summary.html new file mode 100644 index 0000000..1dd299b --- /dev/null +++ b/doc/javadoc/overview-summary.html @@ -0,0 +1,174 @@ + + + + + +Overview (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

kryptoa API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.github.hisahi.tiralabradesaes +
The main package for the program, containing assorted classes, such as + utilities and padding code.
+
com.github.hisahi.tiralabradesaes.blockmodes +
Package containing the block cipher mode of operation interface + as well as three implementations for it: ECB, CBC and CTR.
+
com.github.hisahi.tiralabradesaes.ciphers +
Package containing the cryptographic cipher interface as well as + three implementations of it: DES, 3DES and AES.
+
com.github.hisahi.tiralabradesaes.hash +
Package containing the hash interface and 5 implementations for it: + SHA-1, SHA2-224, SHA2-256, SHA2-384 and SHA2-512.
+
com.github.hisahi.tiralabradesaes.keyderiv +
Package containing the key derivation function interface and an + implementation of PBKDF2 as well as HMAC used by PBKDF2.
+
com.github.hisahi.tiralabradesaes.ui +
Package containing the program interface code, including code for the + command line program.
+
+
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/overview-tree.html b/doc/javadoc/overview-tree.html new file mode 100644 index 0000000..cef624f --- /dev/null +++ b/doc/javadoc/overview-tree.html @@ -0,0 +1,179 @@ + + + + + +Class Hierarchy (kryptoa API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/javadoc/package-list b/doc/javadoc/package-list new file mode 100644 index 0000000..1cc87c4 --- /dev/null +++ b/doc/javadoc/package-list @@ -0,0 +1,6 @@ +com.github.hisahi.tiralabradesaes +com.github.hisahi.tiralabradesaes.blockmodes +com.github.hisahi.tiralabradesaes.ciphers +com.github.hisahi.tiralabradesaes.hash +com.github.hisahi.tiralabradesaes.keyderiv +com.github.hisahi.tiralabradesaes.ui diff --git a/doc/javadoc/script.js b/doc/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/doc/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/doc/javadoc/stylesheet.css b/doc/javadoc/stylesheet.css new file mode 100644 index 0000000..b8dad08 --- /dev/null +++ b/doc/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/doc/ohje.md b/doc/ohje.md index 92f6024..b4fd04a 100644 --- a/doc/ohje.md +++ b/doc/ohje.md @@ -1,7 +1,8 @@ # Ohjelman käyttöohje ## Sovelluksen sijainti -TODO +Valmiin JAR-tiedoston löytää [julkaisuista]( +https://github.com/hisahi/tiralabra-2019-des-aes/releases). ## Sovelluksen käynnistys Sovelluksen voi käynnistää komennolla `java -jar kryptoa.jar`. Ohjelma diff --git a/doc/toteutus.md b/doc/toteutus.md index d47378b..db1dfba 100644 --- a/doc/toteutus.md +++ b/doc/toteutus.md @@ -87,9 +87,9 @@ lopussa olisi 8 tavun lohko tavuja, joiden jokaisen arvo on 8. # Mittauksia Tarkempaa tietoa löytyy testausdokumentista. -Nopeassa testauksessa DES on noin 1/20 OpenSSL:n suorituskyvystä ja AES -noin 1/8. Kaikkia algoritmeja on testattu OpenSSL:ää sekä muita salaus- -ohjelmia vastaan, ja salatut syötteet ovat yhteensopivia. +Nopeassa testauksessa DES on noin 1/21 OpenSSL:n suorituskyvystä ja AES +noin 1/30. Kaikkia algoritmeja on testattu OpenSSL:ää sekä muita +salausohjelmia vastaan, ja salatut syötteet ovat yhteensopivia. # Ohjelman rakenne Ohjelman rakenteesta käytetään laajasti hyödyksi olio-ohjelmoinnin diff --git a/doc/viikko6.md b/doc/viikko6.md new file mode 100644 index 0000000..cdf65a0 --- /dev/null +++ b/doc/viikko6.md @@ -0,0 +1,9 @@ +# Tehdyt asiat +Päivitin hieman dokumentaatiota sekä lisäsin valmiin JAR-tiedoston +julkaisuihin. + +# Seuraavaksi +Mahdollisesti pieniä korjauksia jos niitä keksin. + +# Aika +Käytetty aika noin 1 tunti.