Skip to content

Commit 0541e26

Browse files
committed
Added documentation for Phillips cipher
1 parent f4a4551 commit 0541e26

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

docs/pages/enc/crypto.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,25 @@ This implements the Citrix CTX1 password encoding algorithm.
162162

163163
-----
164164

165+
### Phillips Cipher
166+
167+
This implements Phillips cipher, a polyalphabetic code using 8 grids generated with one keyword.
168+
169+
**Codec** | **Conversions** | **Aliases** | **Comment**
170+
:---: | :---: | --- | ---
171+
`phillips` | text <-> phillips ciphertext | `phillips-key`, `phillips_password`, ... |
172+
173+
```python
174+
>>> codext.encode("this is a test", "phillips_mysuperkey")
175+
'ZCNM NM E XKMVZ'
176+
>>> codext.encode("Another Test String", "phillips-PaSsWoRd")
177+
'SMEZKBE LBON OLEHQHV'
178+
>>> codext.decode("SMEZKBE LBON OLEHQHV", "phillips-password")
179+
'ANOTHER TEST STRINGX'
180+
```
181+
182+
-----
183+
165184
### Polybius Square Cipher
166185

167186
This implements the well-known Polybius Square cipher, using the square with the alphabet in normal order as the default. It can be used dynamically with a custom alphabet.

src/codext/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.16.1
1+
1.16.2

src/codext/crypto/phillips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ def decode(text, errors="strict"):
125125

126126
add("phillips", phillips_encode, phillips_decode, r"^phillips(?:[-_]cipher)?(?:[-_]([a-zA-Z]+))?$", printables_rate=1.,
127127
penalty=.1)
128+

0 commit comments

Comments
 (0)