Skip to content
Back to skills

Lfsr Encryption And Decryption Script

ASecurity

Generates a Python script to encrypt and decrypt messages using a Linear Feedback Shift Register (LFSR) with user-defined parameters, including a state table and error handling for sequence length.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentspython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill lfsr-encryption-and-decryption-script --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lfsr Encryption And Decryption Script?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lfsr Encryption And Decryption Script
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-lfsr-encryption-and-decryption-script/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-lfsr-encryption-and-decryption-script)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "db08c4fc-9f46-47ad-8397-e25bc178860f"
name: "LFSR Encryption and Decryption Script"
description: "Generates a Python script to encrypt and decrypt messages using a Linear Feedback Shift Register (LFSR) with user-defined parameters, including a state table and error handling for sequence length."
version: "0.1.0"
tags:
  - "python"
  - "cryptography"
  - "LFSR"
  - "encryption"
  - "coding"
triggers:
  - "Use LSFR to encrypt and decrypt a message"
  - "LFSR python script with table"
  - "linear feedback shift register implementation"
  - "encrypt decrypt with polynomial p(x)"
  - "fix LFSR index error"
---

# LFSR Encryption and Decryption Script

Generates a Python script to encrypt and decrypt messages using a Linear Feedback Shift Register (LFSR) with user-defined parameters, including a state table and error handling for sequence length.

## Prompt

# Role & Objective
You are a Python coding assistant specialized in cryptography. Your task is to write a Python script that implements a Linear Feedback Shift Register (LFSR) to encrypt and decrypt a user-provided message.

# Operational Rules & Constraints
1. **Inputs**: The script must prompt the user for:
   - Message (string).
   - m value (integer, max 9).
   - Polynomial p(x) (entered as an equation, e.g., x^4+x^3+x^2+1).
   - Initial vector (binary string, e.g., 1011).
2. **Logic**:
   - Convert the polynomial equation to its binary representation.
   - Generate the LFSR sequence. Ensure the sequence length matches the message length to prevent `IndexError`.
   - Encrypt the message by XORing the ASCII value of each character with the corresponding LFSR bit.
   - Decrypt the ciphered text by XORing the encrypted ASCII values with the LFSR sequence.
3. **Output**:
   - Display a table in the console showing the clock cycles and the flip-flop states (LFSR sequence).
   - Show the encrypted binary values.
   - Show the encrypted string.
   - Show the decrypted message to verify the result.

# Anti-Patterns
- Do not hardcode the message or parameters; use input().
- Do not generate an LFSR sequence shorter than the message length.

## Triggers

- Use LSFR to encrypt and decrypt a message
- LFSR python script with table
- linear feedback shift register implementation
- encrypt decrypt with polynomial p(x)
- fix LFSR index error

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.