Update old information

This commit is contained in:
2026-01-26 19:09:23 -05:00
parent ec0bf31906
commit 1943f19b4e
2 changed files with 40 additions and 33 deletions

View File

@@ -1,15 +1,18 @@
# Cipher Stream Java # Cipher Stream Java
This is a Java port of the C++ library [Cipher Stream](https://bitbucket.org/Mattrixwv/CipherStream)
[![Quality Gate Status](https://sonarqube.mattrixwv.com/api/project_badges/measure?project=CipherStreamJava&metric=alert_status&token=sqb_05b96962e58c5c32ea792ecf2acb78d261561c54)](https://sonarqube.mattrixwv.com/dashboard?id=CipherStreamJava)
This is a Java port of the C++ library [Cipher Stream](https://git.mattrixwv.com/BaseLibraries/CipherStream)
## Combination ## Combination
TODO: TODO:
### ADFGX ### ADFGX
TODO: TODO:
Example: ```txt
```
Square Keyword = SQUAREKEYWORD Square Keyword = SQUAREKEYWORD
Keyword = KEYWORD Keyword = KEYWORD
Message = Message to encode Message = Message to encode
@@ -17,114 +20,114 @@ AAGAGADFAGAXXDAXDXADAFAFXDDGDF
``` ```
### ADFGVX ### ADFGVX
TODO: TODO:
Example: ```txt
```
Square Keyword = SQUAREKEYWORD Square Keyword = SQUAREKEYWORD
Keyword = KEYWORD Keyword = KEYWORD
Message = Message to encode Message = Message to encode
AXGVDAVFXGAGFAAFAGAAXDXFGDAGDA AXGVDAVFXGAGFAAFAGAAXDXFGDAGDA
``` ```
## Mono-Substitution ## Mono-Substitution
These are simple ciphers where a single character is transformed into a single or multiple characters the same way each time it is encountered in the input. These are simple ciphers and easy to break. These are simple ciphers where a single character is transformed into a single or multiple characters the same way each time it is encountered in the input. These are simple ciphers and easy to break.
### BaseX ### BaseX
This is not technically a cipher, it simply converts ASCII characters to their numeric values at a given base. The most common use for this is to transform text to binary, octal, or hexadecimal. Strictly speaking it does not require a key, however you do need to include the base that you wish to use. This is not technically a cipher, it simply converts ASCII characters to their numeric values at a given base. The most common use for this is to transform text to binary, octal, or hexadecimal. Strictly speaking it does not require a key, however you do need to include the base that you wish to use.
Example: ```txt
```
Message to encode -> Message to encode ->
1001101 1100101 1110011 1110011 1100001 1100111 1100101 100000 1110100 1101111 100000 1100101 1101110 1100011 1101111 1100100 1100101 1001101 1100101 1110011 1110011 1100001 1100111 1100101 100000 1110100 1101111 100000 1100101 1101110 1100011 1101111 1100100 1100101
``` ```
### Baconian ### Baconian
The Baconian cipher is similar to Base2 encoding (binary) except that the alphabet starts at A = 0, instead of 0's and 1's it uses a's and b's, and I and J share an encoding space, as do U and V. It does not require a key. The Baconian cipher is similar to Base2 encoding (binary) except that the alphabet starts at A = 0, instead of 0's and 1's it uses a's and b's, and I and J share an encoding space, as do U and V. It does not require a key.
Example: ```txt
```
Message to encode -> Message to encode ->
ababb aabaa baaab baaab aaaaa aabba aabaa baaba abbab aabaa abbaa aaaba abbab aaabb aabaa ababb aabaa baaab baaab aaaaa aabba aabaa baaba abbab aabaa abbaa aaaba abbab aaabb aabaa
``` ```
### Caesar ### Caesar
The Caesar cipher offsets the letters in the alphabet by a given amount. It does require a "key" of sorts in that you must set how far the message needs to be shifted. The Caesar cipher offsets the letters in the alphabet by a given amount. It does require a "key" of sorts in that you must set how far the message needs to be shifted.
Example: ```txt
```
offset = 3 offset = 3
Message to encode -> Message to encode ->
Phvvdjh wr hqfrgh Phvvdjh wr hqfrgh
``` ```
### Atbash ### Atbash
The Atbash cipher reverses the alphabet for encryption. i.e. a = z, b = y, .... It does not require a key. The Atbash cipher reverses the alphabet for encryption. i.e. a = z, b = y, .... It does not require a key.
Example: ```txt
```
Message to enocde -> Message to enocde ->
Nvhhztv gl vmxlwv Nvhhztv gl vmxlwv
``` ```
### Vigenere ### Vigenere
TODO: The Vigenere cipher shifts each letter in the input a varied amount based on the letters in the key, with 'a' shifting the letter 0 places, 'b' shifting the letter 1 place, etc. If the message is longer than the key you simply start back over at the beginning of the key. It does require a key word/phrase. TODO: The Vigenere cipher shifts each letter in the input a varied amount based on the letters in the key, with 'a' shifting the letter 0 places, 'b' shifting the letter 1 place, etc. If the message is longer than the key you simply start back over at the beginning of the key. It does require a key word/phrase.
Example: ```txt
```
key = keyword key = keyword
Message to encode -> Message to encode ->
Wiqooxh ds cjqfgo Wiqooxh ds cjqfgo
``` ```
### Autokey ### Autokey
The Autokey cipher works in a similar way to the Vigenere cipher except that instead of reusing the key when you reach the end of it, you tack on the beginning of the message to the key. This way the key does not repeat, making it harder to crack. It does require a key word/phrase. The Autokey cipher works in a similar way to the Vigenere cipher except that instead of reusing the key when you reach the end of it, you tack on the beginning of the message to the key. This way the key does not repeat, making it harder to crack. It does require a key word/phrase.
Example: ```txt
```
key = keyword key = keyword
Message to encode -> Message to encode ->
Wiqooxh fs wfcuhx Wiqooxh fs wfcuhx
``` ```
## Poly-Substitution ## Poly-Substitution
These ciphers are slightly more complex, encoding multiple letters at the same time making the cipher harder to crack. While many of these keep one letter from always being encoded as another single letter it often does so in such a way that if multiple letters are often seen together they will be encoded the same way. This is offset somewhat because they have to appear in the same location in the cipher text % the number of letters you are encoding by. i.e. If you are using a cipher that encodes with pairs the 'es' in 'mess' and 'these' would not encode to the same thing because 'me' and 'ss' are encoded in the first example while 'th', 'es', 'e_' are encoded in the second, unless there were an odd number of characters before one of these words, shifting one of the words by one place. These ciphers are slightly more complex, encoding multiple letters at the same time making the cipher harder to crack. While many of these keep one letter from always being encoded as another single letter it often does so in such a way that if multiple letters are often seen together they will be encoded the same way. This is offset somewhat because they have to appear in the same location in the cipher text % the number of letters you are encoding by. i.e. If you are using a cipher that encodes with pairs the 'es' in 'mess' and 'these' would not encode to the same thing because 'me' and 'ss' are encoded in the first example while 'th', 'es', 'e_' are encoded in the second, unless there were an odd number of characters before one of these words, shifting one of the words by one place.
### Columnar ### Columnar
TODO: TODO:
Example: ```txt
```
key = keyword key = keyword
Message to encode -> Message to encode ->
Edxeoxm te acxgoxsnxsex Edxeoxm te acxgoxsnxsex
``` ```
### Morse ### Morse
This is technically not a cipher, at least any more than writing is encoded speach, as it is meant to enocde information for transmission in a different media. It has been around for a long time and used to be widely known and used, though in recent years it is mainly used by hobbyists. Using this code a letter or number is converted to 1 or more .'s and -'s (dots and dashes or dits and dahs). It does not require a key. This is technically not a cipher, at least any more than writing is encoded speach, as it is meant to enocde information for transmission in a different media. It has been around for a long time and used to be widely known and used, though in recent years it is mainly used by hobbyists. Using this code a letter or number is converted to 1 or more .'s and -'s (dots and dashes or dits and dahs). It does not require a key.
Example: ```txt
```
Message to encode -> Message to encode ->
-- . ... ... .- --. . - --- . -. -.-. --- -.. . -- . ... ... .- --. . - --- . -. -.-. --- -.. .
``` ```
### Playfair ### Playfair
TODO: TODO:
Example: ```txt
```
Message to encode -> Message to encode ->
NKQZPCNDZKDULCGD NKQZPCNDZKDULCGD
``` ```
### PolybiusSquare ### PolybiusSquare
TODO: TODO:
Example: ```txt
```
Message to encode -> Message to encode ->
41124545233212 5115 124225152212 41124545233212 5115 124225152212
``` ```

16
pom.xml
View File

@@ -19,9 +19,9 @@
</developers> </developers>
<scm> <scm>
<connection>scm:git:git://bitbucket.org/Mattrixwv/CipherStreamJava.git</connection> <connection>scm:git:git://git.mattrixwv.com/HomeLab/CipherStreamJava.git</connection>
<developerConnection>scm:git:ssh://bitbucket.org:Mattrixwv/CipherStreamJava.git</developerConnection> <developerConnection>scm:git:ssh://git.mattrixwv.com/HomeLab/CipherStreamJava.git</developerConnection>
<url>https://bitbucket.org/Mattrixwv/CipherStreamJava/src</url> <url>https://git.mattrixwv.com/HomeLab/CipherStreamJava</url>
</scm> </scm>
<groupId>com.mattrixwv</groupId> <groupId>com.mattrixwv</groupId>
@@ -80,7 +80,7 @@
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId> <artifactId>junit-jupiter-params</artifactId>
<version>6.0.1</version> <version>6.0.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -150,6 +150,10 @@
</plugin> </plugin>
<!--Deployment--> <!--Deployment-->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
@@ -263,7 +267,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId> <artifactId>versions-maven-plugin</artifactId>
<version>2.20.1</version> <version>2.21.0</version>
<configuration> <configuration>
<rulesUri>file://${session.executionRootDirectory}/version-rules.xml</rulesUri> <rulesUri>file://${session.executionRootDirectory}/version-rules.xml</rulesUri>
</configuration> </configuration>
@@ -303,7 +307,7 @@
<plugin> <plugin>
<groupId>org.owasp</groupId> <groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId> <artifactId>dependency-check-maven</artifactId>
<version>12.1.9</version> <version>12.2.0</version>
<configuration> <configuration>
<formats> <formats>
<format>json</format> <format>json</format>