https://github.com/typek22/cfmx_compat_python
A Python implementation of ColdFusion default encryption and decryption with CFMX_COMPAT and UUEncoding based on Railo source.
https://github.com/typek22/cfmx_compat_python
cfmx-compat coldfusion decrypt encrypt python railo security uuencode
Last synced: about 1 month ago
JSON representation
A Python implementation of ColdFusion default encryption and decryption with CFMX_COMPAT and UUEncoding based on Railo source.
- Host: GitHub
- URL: https://github.com/typek22/cfmx_compat_python
- Owner: typek22
- License: lgpl-2.1
- Created: 2025-01-23T09:42:54.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-23T10:46:55.000Z (4 months ago)
- Last Synced: 2025-02-15T05:20:56.478Z (3 months ago)
- Topics: cfmx-compat, coldfusion, decrypt, encrypt, python, railo, security, uuencode
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python CFMX_COMPAT ColdFusion Encryption
This project provides a Python implementation of the ColdFusion encrypt and decrypt functions with the default configuration. This project provides the exact same functionality as ColdFusion's built-in encryption and decryption, ensuring compatibility for applications that need to work with ColdFusion-encrypted data.
The implementation is based on the open-source Railo project, ensuring accuracy and compatibility with ColdFusion's encryption standards.
⚠️ The CFMX_COMPAT algorithm, used in ColdFusion for encryption, is known for its significant security weaknesses. It should NOT be used for encryption of any data.
Instead, it can be used for:
- Interoperability with ColdFusion
- Decoding ColdFusion-Encrypted Data
- ColdFusion to Python Migration
- Reverse Engineering & Security Audits## Features
- Compatible with ColdFusion's default encryption and decryption functions.
- **UUCoder**: Implements encoding and decoding using UUEncoding format.
- **Transformer**: Implements a LFSR-based transformation algorithm for encryption/decryption.
- **CFMXCompat**: Provides a high-level interface for encrypting and decrypting data using both the UUCoder and Transformer.## Requirements
- Python 3.x
- No external dependencies are required, only built-in Python libraries.## Usage
### Run right away
```bash
$ git clone https://github.com/typek22/cfmx_compat_python.git
$ cd cfmx_compat_python
$ python main.py
```### Adjust the parameter in main.py and run
```python
key = "86090ec89fa81d7b"
encrypted_text = "#2 B+"
plain_text = "Cat"
```
```console
$ python main.pyENCRYPTION original: 'Cat', encrypted: '#3P:8'.
DECRYPTION original: '#2 B+', decrypted: 'Dog'.
```### Or incorporate into your project
```python
from crypt.cfmx_compat import CFMXCompatkey = "e3548384e1ee4c26"
encrypted_text = "&6%Z,LJ6Z"
plain_text = "Rabbit"decrypted = CFMXCompat.decrypt(encrypted_text, key)
encrypted = CFMXCompat.encrypt(plain_text, key)
```
This is the same as following CFML code
```cfmkey = "e3548384e1ee4c26";
encrypted_text = "&6%Z,LJ6Z"
plain_text = "Rabbit"
decrypted = decrypt(encrypted_text, key);
encrypted = encrypt(plain_text, key);```