Commit Graph

38 Commits

Author SHA1 Message Date
duvvuvenkataramana
8d2cdb27db feat: implement One-Time Pad cipher (#6941) (#7096)
* feat: implement One-Time Pad cipher (#6941)

* style: format OneTimePadCipher with clang-format
2025-12-01 20:17:32 +00:00
Dheeraj Kumar
c06dc292fe feat(ciphers): Add PermutationCipher implementation(enhance #6697) (#6700)
* feat(ciphers): Add PermutationCipher implementation with comprehensive tests

- Implement PermutationCipher class for transposition encryption/decryption
- Add encrypt() and decrypt() methods with permutation key support
- Include robust key validation (1-based positions, no duplicates)
- Implement automatic padding for incomplete blocks using 'X' character
- Add comprehensive error handling with descriptive exceptions
- Create 20+ JUnit test cases covering encryption, decryption, edge cases
- Support various key sizes and text processing (spaces removal, case handling)
- Include detailed JavaDoc documentation with algorithm explanation

Algorithm Details:
- Divides plaintext into blocks based on key length
- Rearranges characters within each block according to permutation positions
- Supports round-trip encryption/decryption with inverse permutation
- Handles edge cases: empty strings, single character keys, padding

Tests include: basic functionality, different key sizes, error validation,
real-world examples, and edge case handling.

* Run PermutationCipherTest using Maven

* refactor(PermutationCipher): clean up code by removing unnecessary whitespace and comments

* fix(tests): remove unnecessary whitespace in test assertion for encryption

* fix(tests): correct indentation in assertion for encryption verification

---------

Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-08 08:42:58 +02:00
Hardik Pawar
8b604858f5 Enhance docs, add more tests in Vigenere (#5899) 2024-10-26 18:50:31 +00:00
Hardik Pawar
08bd1ffe73 Refactor AtbashCipher, add ParameterizedTest (#5808) 2024-10-26 15:33:33 +00:00
Hardik Pawar
4e46002103 Enhance docs, add more tests in XORCipher (#5900) 2024-10-26 18:07:47 +03:00
Hardik Pawar
4d85c61c37 Enhance docs, add more tests in RSA (#5898) 2024-10-26 14:50:32 +00:00
Hardik Pawar
3de202b953 Enhance docs, add more tests in ADFGVXCipher (#5897) 2024-10-26 14:46:02 +00:00
Benjamin Burstein
87030aff1e Add BaconianCipher (#5932) 2024-10-22 18:30:37 +00:00
Ritisha Pande
c56d282ae0 Add DiffieHellman and MonoAlphabetic (#5508) 2024-10-22 18:16:35 +00:00
Varnan Rathod
b35f98a67a Add Rail Fence Cipher (#5761) 2024-10-15 18:23:10 +03:00
Piotr Idzik
ebc3cd2233 style: resolve some FCBL_FIELD_COULD_BE_LOCAL warnings (#5764)
style: make simple fields local
2024-10-13 15:16:10 +00:00
Benjamin Burstein
f8397bf09b Add ADFGVX Cipher (#5631) 2024-10-12 10:34:49 +03:00
Varnan Rathod
2338428578 Add cipher class, cipher tests, enhance docs in 'AtbashCipher.java' (#5690) 2024-10-11 06:05:26 +00:00
xuyang471
2040df88d9 Add Elliptic Curve Cryptography (#5700) 2024-10-11 05:47:36 +00:00
SAIVARDHAN15
6e6028e3d0 Fix columnarTranspositionCipher and typos in Test (#5649) 2024-10-09 22:41:25 +03:00
Hardik Pawar
25dc55e4ae Add Junit tests for ColumnarTranspositionCipher.java (#5599) 2024-10-07 15:11:56 +00:00
Hardik Pawar
f80850b244 Add Junit tests for AffineCipher.java, improve documentation (#5598) 2024-10-07 18:08:55 +03:00
Hardik Pawar
99d7f80a61 Add Junit tests for AESEncryption.java (#5597) 2024-10-07 18:00:57 +03:00
Hardik Pawar
26e8ead4ed Add tests for A5Cipher.java, improve class & function documentation (#5594) 2024-10-07 14:28:01 +00:00
Hardik Pawar
93cfa86a97 Add tests for A5KeyStreamGenerator.java, improve documentation (#5595) 2024-10-07 14:23:21 +00:00
Benjamin Burstein
07cb6c46a8 Add autokey cipher (#5569) 2024-10-06 05:37:56 +00:00
Benjamin Burstein
393337fa8e Add Tests for HillCipher (#5562) 2024-10-04 17:18:51 +00:00
Luiz Carlos Jr
41f767ef94 Add XOR Cipher (#5490) 2024-10-04 16:10:18 +00:00
Piotr Idzik
414835db11 style: enable AvoidStarImport in checkstyle (#5141) 2024-05-05 20:48:56 +02:00
Piotr Idzik
de18d0df7e style: enable EmptyStatement (#5120) 2024-04-26 22:39:03 +03:00
Govind Gupta
9bef5a169c Add Playfair Cipher (#4988) 2024-01-03 15:14:38 +02:00
aryan1165
7ece806cf5 Remove duplicate file of Simple Substitution Cipher (fixes #4494) (#4495) 2023-12-26 00:24:28 +02:00
acbin
00282efd8b style: format code (#4212)
close #4204
2023-06-09 18:52:05 +08:00
Aditya Pal
19bd2408ff Des (#4172)
* Update directory

* Add DES Encryption algorithm

* Update directory

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-04-30 20:19:14 +05:30
Hikmet Çakır
54d6f79acd Add SimpleSubstitutionCipherTest (#3857) 2023-01-17 22:05:24 +02:00
Alexandre Velloso
cc17d60d5c Add unit tests for SimpleSubCipher (#3688) 2022-11-06 10:21:22 +00:00
Alexandre Velloso
8c6ed9c240 Add unit test for RSA cipher (#3664) 2022-10-26 09:10:27 +08:00
Alexandre Velloso
f8897f166d Add unit tests for Caesar cipher (#3665)
Co-authored-by: Yang Libin <contact@yanglibin.info>
2022-10-26 09:01:35 +08:00
Alexandre Velloso
7ef75980d5 Add unit tests for Vigenere cipher (#3666) 2022-10-26 08:57:51 +08:00
acbin
e96f567bfc Format code with prettier (#3375) 2022-10-03 17:23:00 +08:00
J2mF
e4eb99ff18 Add A5 Cipher (#3292) 2022-09-27 16:33:13 +00:00
Hikmet Çakır
199c85d191 Add Polybius Cipher (#3185) 2022-07-11 15:15:14 +00:00
Akshay Dubey
f9b788f7f4 Add Blowfish Algorithm (#3052) 2022-05-18 20:29:31 +03:00