Skip to main content

🔐 Biblioteca de utilidades para hash de senha, criptografia e JWT em Python

Project description

🔐 SmartSecurityPy

SmartSecurityPy é uma biblioteca Python leve e poderosa para tarefas de segurança como hash de senha, criptografia simétrica e validação de JWTs. Ideal para APIs, backends e projetos que precisam de proteção de dados sensíveis.


⚙️ Instalação

pip install SmartSecurityPy

Requer Python 3.7 ou superior


✨ Funcionalidades

🔑 Hash de Senhas com Bcrypt

from SmartSecurityPy import hasher

hashed = hasher.hash_password("minha_senha_segura")
print(hashed)

# Verificação
autenticado = hasher.verify_password("minha_senha_segura", hashed)
print(autenticado)  # True

🔒 Criptografia e Descriptografia com Fernet

from SmartSecurityPy import crypto

# Gera uma chave segura
key = crypto.generate_key()

# Criptografa uma mensagem
mensagem = "dado confidencial"
token = crypto.encrypt_message(mensagem, key)

# Descriptografa
original = crypto.decrypt_message(token, key)
print(original)  # "dado confidencial"

🪙 JWT (JSON Web Tokens)

from SmartSecurityPy import jwt_handler

# Cria um token JWT
data = {"user_id": 123, "role": "admin"}
token = jwt_handler.create_token(data, expires_in_minutes=30)

# Decodifica o token
decoded = jwt_handler.decode_token(token)
print(decoded)

# Verifica se é válido
print(jwt_handler.is_token_valid(token))  # True

📁 Estrutura do Projeto

SmartSecurityPy/
├── SmartSecurityPy/
│   ├── __init__.py
│   ├── hasher.py          # 🔑 Hash de senha
│   ├── crypto.py          # 🔒 Criptografia simétrica
│   └── jwt_handler.py     # 🪙 Geração e validação de JWT
│
├── tests/
│   ├── test_hasher.py
│   ├── test_crypto.py
│   └── test_jwt_handler.py
│
├── setup.py
├── pyproject.toml
├── README.md
└── LICENSE

🧪 Testes

Execute os testes com pytest:

pytest tests/

🧠 Autor

Roberto Lima
🔗 GitHub: robertolima-dev
📧 Email: robertolima.izphera@gmail.com


💬 Contato


Gostou do projeto?

Deixe uma ⭐ no repositório e compartilhe com a comunidade! 🚀✨

git clone https://github.com/robertolima-dev/SmartSecurityPy.git
cd SmartSecurityPy
pip install -e .

🌟 O que este README oferece?

  • 🎯 Descrição clara do projeto e seu propósito.
  • 🛠 Instruções detalhadas de instalação e uso prático.
  • 🏗 Estrutura do projeto para facilitar a navegação.
  • 📝 Licença e informações do autor para transparência.

📄 Licença

MIT License - use livremente com reconhecimento. 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartsecuritypy-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartsecuritypy-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file smartsecuritypy-0.1.0.tar.gz.

File metadata

  • Download URL: smartsecuritypy-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for smartsecuritypy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c4b93b6ad304e09f5f948b96b4c75148226d251ccc0477543bbb4e447af5e2ce
MD5 fae436a7751149185d44199abef74731
BLAKE2b-256 1d7c0939a094612e4154b58621bd96ce574aca3f871bd2094b21cee04887d53a

See more details on using hashes here.

File details

Details for the file smartsecuritypy-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for smartsecuritypy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65afdf68ee284a49e382d5f8b6e43e8e87698cd1dc51e4b51275e7433de99249
MD5 15a8d46ce56507147843d48df5bb9aec
BLAKE2b-256 5983b8fae67e36721f0819c3265026d43eabdebea0b7a8741acba8a89c193d7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page