2
0
woollybah 5 жил өмнө
parent
commit
5d1cb4dbd2

+ 44 - 0
docs/api/crypto/crypto.cipher/tcipher.md

@@ -0,0 +1,44 @@
+---
+id: tcipher
+title: TCipher
+sidebar_label: TCipher
+---
+
+Cipher base type.
+
+
+## Methods
+
+### `Method KeySize:Int(size:Int) Abstract`
+
+Returns the appropriate key size for <b>size</b>.
+
+Rounds the input keysize <b>size</b> down to the next appropriate key size for use with the cipher.
+
+
+<br/>
+
+### `Method Name:String() Abstract`
+
+Returns the name of the cipher.
+
+<br/>
+
+## Functions
+
+### `Function ListCiphers:String[]()`
+
+Returns a list of all registered ciphers.
+
+<br/>
+
+### `Function Find:TCipher(name:String)`
+
+Gets the cipher index of the given <b>name</b>.
+
+#### Returns
+the index or -1 if not found.
+
+
+<br/>
+

+ 9 - 0
docs/api/crypto/crypto.cipher/tciphermode.md

@@ -0,0 +1,9 @@
+---
+id: tciphermode
+title: TCipherMode
+sidebar_label: TCipherMode
+---
+
+Base type for cipher chaining modes.
+
+

+ 12 - 0
docs/api/crypto/crypto_aescipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.aescipher
+title: Crypto.AESCipher
+sidebar_label: Crypto.AESCipher
+---
+
+
+AES is a subset of the Rijndael block cipher.
+
+See <https://en.wikipedia.org/wiki/Advanced_Encryption_Standard>
+
+

+ 13 - 0
docs/api/crypto/crypto_anubiscipher.md

@@ -0,0 +1,13 @@
+---
+id: crypto.anubiscipher
+title: Crypto.AnubisCipher
+sidebar_label: Crypto.AnubisCipher
+---
+
+
+Anubis operates on data blocks of 128 bits, accepting keys of length 32N bits `(N = 4, ..., 10)`.
+It is designed as a substitution-permutation network, which bears large similarity to [Crypto.AESCipher](../crypto/crypto_aescipher.md).
+
+See <https://en.wikipedia.org/wiki/Anubis_(cipher)>
+
+

+ 12 - 0
docs/api/crypto/crypto_blowfishcipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.blowfishcipher
+title: Crypto.BlowfishCipher
+sidebar_label: Crypto.BlowfishCipher
+---
+
+
+Blowfish has a 64-bit block size and a variable key length from 32 bits up to 448 bits.
+
+See <https://en.wikipedia.org/wiki/Blowfish_(cipher)>
+
+

+ 12 - 0
docs/api/crypto/crypto_camelliacipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.camelliacipher
+title: Crypto.CamelliaCipher
+sidebar_label: Crypto.CamelliaCipher
+---
+
+
+Camellia has a block size of 128 bits and key sizes of 128, 192 and 256 bits.
+
+See <https://en.wikipedia.org/wiki/Camellia_(cipher)>
+
+

+ 12 - 0
docs/api/crypto/crypto_cast5cipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.cast5cipher
+title: Crypto.Cast5Cipher
+sidebar_label: Crypto.Cast5Cipher
+---
+
+
+Also known as CAST-128, it has a 64-bit block size and a key size of between 40 and 128 bits (in 8-bit increments).
+
+See <https://en.wikipedia.org/wiki/CAST-128>
+
+

+ 48 - 0
docs/api/crypto/crypto_cipher.md

@@ -0,0 +1,48 @@
+---
+id: crypto.cipher
+title: Crypto.Cipher
+sidebar_label: Crypto.Cipher
+---
+
+
+### Supported Ciphers
+
+| Name          | Block Size (bytes) | Key Range (bytes) | Rounds |
+|---|---|---|---|
+| [Crypto.BlowfishCipher](../crypto/crypto_blowfishcipher.md)   | 8  | 8 ... 56   | 16 |
+| [Crypto.XteaCipher](../crypto/crypto_xteacipher.md)       | 8  | 16         | 32 |
+| [Crypto.AESCipher](../crypto/crypto_aescipher.md)        | 16 | 16, 24, 32 | 10, 12, 14 |
+| [Crypto.TwofishCipher](../crypto/crypto_twofishcipher.md)    | 16 | 16, 24, 32 | 16 |
+| [Crypto.DESCipher](../crypto/crypto_descipher.md)        | 8  | 8          | 16 |
+| 3DES (EDE mode) (See [Crypto.DESCipher](../crypto/crypto_descipher.md)) | 8  | 16, 24     | 16 |
+| [Crypto.Cast5Cipher](../crypto/crypto_cast5cipher.md)      | 8  | 5 ... 16   | 12, 16 |
+| [Crypto.NoekeonCipher](../crypto/crypto_noekeoncipher.md)    | 16 | 16         | 16 |
+| [Crypto.SkipjackCipher](../crypto/crypto_skipjackcipher.md)   | 8  | 10         | 32 |
+| [Crypto.AnubisCipher](../crypto/crypto_anubiscipher.md)     | 16 | 16 ... 40  | 12 ... 18 |
+| [Crypto.KhazadCipher](../crypto/crypto_khazadcipher.md)     | 8  | 16         | 8 |
+| [Crypto.KSEEDCipher](../crypto/crypto_kseedcipher.md)      | 16 | 16         | 16 |
+| [Crypto.KASUMICipher](../crypto/crypto_kasumicipher.md)     | 8  | 16         | 8 |
+| [Crypto.CamelliaCipher](../crypto/crypto_camelliacipher.md)   | 16 | 16, 24, 32 | 18, 24 |
+| [Crypto.IDEACipher](../crypto/crypto_ideacipher.md)       | 8  | 16         | 8 |
+| [Crypto.SerpentCipher](../crypto/crypto_serpentcipher.md)    | 16 | 16, 24, 32 | 32 |
+
+### Key sizes and Number of Rounds
+
+As a general rule of thumb, do not use symmetric keys under 80 bits if you can help it.
+Only a few of the ciphers support smaller keys (mainly for test vectors anyways).
+Ideally, your application should be making at least 256 bit keys. This is not because you are to be paranoid.
+It is because if your PRNG has a bias of any sort the more bits the better.
+For example, if you have `Pr[X = 1] = 1/2 ±γ` where `|γ| > 0` then the total amount of entropy in N bits is `N·−log^2 (1/2 +|γ|)`.
+So if `γ` were 0.25 (a severe bias) a 256-bit string would have about 106 bits of entropy whereas a 128-bit string would have only 53 bits of entropy.
+
+The number of rounds of most ciphers is not an option you can change. Only RC5 allows you to change the number of rounds.
+By passing zero as the number of rounds all ciphers will use their default number of rounds. Generally the ciphers are configured such that the default
+number of rounds provide adequate security for the given block and key size.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TCipher](../../crypto/crypto.cipher/tcipher) | Cipher base type. |
+| [TCipherMode](../../crypto/crypto.cipher/tciphermode) | Base type for cipher chaining modes. |
+

+ 12 - 0
docs/api/crypto/crypto_descipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.descipher
+title: Crypto.DESCipher
+sidebar_label: Crypto.DESCipher
+---
+
+
+Incorprates the legacy Data Encryption Standard 56-bit key cipher and its more scure successor 3DES with key sizes of 168, 112 or 56 bits.
+
+See <https://en.wikipedia.org/wiki/Data_Encryption_Standard>
+
+

+ 12 - 0
docs/api/crypto/crypto_ideacipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.ideacipher
+title: Crypto.IdeaCipher
+sidebar_label: Crypto.IdeaCipher
+---
+
+
+Operates on 64-bit blocks using a 128-bit key.
+
+See <https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm>
+
+

+ 12 - 0
docs/api/crypto/crypto_kasumicipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.kasumicipher
+title: Crypto.KasumiCipher
+sidebar_label: Crypto.KasumiCipher
+---
+
+
+Consists of a 128-bit key with 64-bit blocks.
+
+See <https://en.wikipedia.org/wiki/KASUMI>
+
+

+ 12 - 0
docs/api/crypto/crypto_khazadcipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.khazadcipher
+title: Crypto.KhazadCipher
+sidebar_label: Crypto.KhazadCipher
+---
+
+
+KHAZAD has an eight-round substitution–permutation network structure.
+
+See <https://en.wikipedia.org/wiki/KHAZAD>
+
+

+ 12 - 0
docs/api/crypto/crypto_kseedcipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.kseedcipher
+title: Crypto.KSeedCipher
+sidebar_label: Crypto.KSeedCipher
+---
+
+
+The cipher comprises 128-bit blocks and a 128-bit key.
+
+See <https://en.wikipedia.org/wiki/SEED>
+
+

+ 12 - 0
docs/api/crypto/crypto_noekeoncipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.noekeoncipher
+title: Crypto.NoekeonCipher
+sidebar_label: Crypto.NoekeonCipher
+---
+
+
+NOEKEON has a 128-bit block and key size.
+
+See <https://en.wikipedia.org/wiki/NOEKEON>
+
+

+ 12 - 0
docs/api/crypto/crypto_serpentcipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.serpentcipher
+title: Crypto.SerpentCipher
+sidebar_label: Crypto.SerpentCipher
+---
+
+
+Serpent has a block size of 128 bits and supports key sizes of 128, 192 or 256 bits.
+
+See <https://en.wikipedia.org/wiki/Serpent_(cipher)>
+
+

+ 12 - 0
docs/api/crypto/crypto_skipjackcipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.skipjackcipher
+title: Crypto.SkipjackCipher
+sidebar_label: Crypto.SkipjackCipher
+---
+
+
+Skipjack uses an 80-bit key to encrypt or decrypt 64-bit data blocks.
+
+See <https://en.wikipedia.org/wiki/Skipjack_(cipher)>
+
+

+ 12 - 0
docs/api/crypto/crypto_twofishcipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.twofishcipher
+title: Crypto.TwofishCipher
+sidebar_label: Crypto.TwofishCipher
+---
+
+
+Twofish has a block size of 128 bits and key sizes of 128, 192 or 256 bits.
+
+See <https://en.wikipedia.org/wiki/Twofish>
+
+

+ 12 - 0
docs/api/crypto/crypto_xteacipher.md

@@ -0,0 +1,12 @@
+---
+id: crypto.xteacipher
+title: Crypto.XTeaCipher
+sidebar_label: Crypto.XTeaCipher
+---
+
+
+XTEA works on 64-bit blocks with a 128-bit key.
+
+See <https://en.wikipedia.org/wiki/XTEA>
+
+

+ 24 - 0
website/sidebars.json

@@ -408,6 +408,30 @@
           "api/crypto/crypto.digest/tnosuchalgorithmexception"
         ]
       },
+      {
+        "type": "subcategory",
+        "label": "Crypto.Cipher",
+        "ids": [
+          "api/crypto/crypto.cipher",
+          "api/crypto/crypto.cipher/tcipher",
+          "api/crypto/crypto.cipher/tciphermode",
+          "api/crypto/crypto.aescipher",
+          "api/crypto/crypto.anubiscipher",
+          "api/crypto/crypto.blowfishcipher",
+          "api/crypto/crypto.camelliacipher",
+          "api/crypto/crypto.cast5cipher",
+          "api/crypto/crypto.descipher",
+          "api/crypto/crypto.ideacipher",
+          "api/crypto/crypto.kasumicipher",
+          "api/crypto/crypto.khazadcipher",
+          "api/crypto/crypto.kseedcipher",
+          "api/crypto/crypto.noekeoncipher",
+          "api/crypto/crypto.serpentcipher",
+          "api/crypto/crypto.skipjackcipher",
+          "api/crypto/crypto.twofishcipher",
+          "api/crypto/crypto.xteacipher"
+        ]
+      },
       {
         "type": "subcategory",
         "label": "Crypto.CRC32",