Cybersecurity and AI tools by Eurocybersecurite
Project description
ECS - Eurocybersecurite Cybersecurity Tools
This project contains cybersecurity and AI tools by Eurocybersecurite.
Structure du projet
ecs_project_v0.3.0/
├── ecs/
│ ├── __init__.py
│ ├── core.py
│ ├── crypto.py
│ ├── audit.py
│ └── ai_tools.py
├── tests/
│ ├── test_core.py
│ ├── test_crypto.py
│ ├── test_audit.py
│ └── test_ai_tools.py
├── README.md
├── LICENSE
├── setup.py
├── pyproject.toml
└── requirements.txt
Fichiers clés
ecs/init.py
"""ECS - Eurocybersecurite Cybersecurity Tools"""
from .core import greet
from .crypto import hash_text
from .audit import check_log_suspicious
from .ai_tools import classify_text, classify_text_advanced, detect_anomalies_in_logs
__all__ = ["greet", "hash_text", "check_log_suspicious", "classify_text", "classify_text_advanced", "detect_anomalies_in_logs"]
ecs/core.py
def greet(name: str) -> str:
return f"Hello {name}, welcome to ECS by Eurocybersecurite!"
ecs/crypto.py
import hashlib
def hash_text(text: str) -> str:
return hashlib.sha256(text.encode('utf-8')).hexdigest()
ecs/audit.py
def check_log_suspicious(file_path: str):
suspicious_keywords = ["error", "failed", "unauthorized", "warning"]
alerts = []
try:
with open(file_path, 'r', encoding='utf-8') as f:
for line in f:
if any(keyword in line.lower() for keyword in suspicious_keywords):
alerts.append(line.strip())
except FileNotFoundError:
alerts.append(f"File not found: {file_path}")
return alerts
ecs/ai_tools.py
# Dummy AI tools for ECS
def classify_text(text: str) -> str:
suspicious_keywords = ["attack", "breach", "malware", "unauthorized"]
return "suspicious" if any(word in text.lower() for word in suspicious_keywords) else "safe"
def classify_text_advanced(text: str) -> str:
# Placeholder for NLP model
return classify_text(text)
def detect_anomalies_in_logs(file_path: str):
alerts = []
try:
with open(file_path, 'r', encoding='utf-8') as f:
for line in f:
if any(word in line.lower() for word in ["error", "failed", "unauthorized", "attack"]):
alerts.append(line.strip())
except FileNotFoundError:
alerts.append(f"File not found: {file_path}")
return alerts
tests/test_core.py
from ecs.core import greet
def test_greet():
assert greet("Mohamed") == "Hello Mohamed, welcome to ECS by Eurocybersecurite!"
tests/test_crypto.py
from ecs.crypto import hash_text
import hashlib
def test_hash_text():
text = "mypassword"
assert hash_text(text) == hashlib.sha256(text.encode('utf-8')).hexdigest()
tests/test_audit.py
from ecs.audit import check_log_suspicious
def test_check_log_suspicious(tmp_path):
log_file = tmp_path / "test.log"
log_file.write_text("Error: unauthorized access\nAll good\n")
alerts = check_log_suspicious(str(log_file))
assert "Error: unauthorized access" in alerts
tests/test_ai_tools.py
from ecs.ai_tools import classify_text, classify_text_advanced, detect_anomalies_in_logs
def test_classify_text():
assert classify_text("This is an attack") == "suspicious"
assert classify_text("All systems normal") == "safe"
def test_classify_text_advanced():
assert classify_text_advanced("This is an attack") == "suspicious"
def test_detect_anomalies_in_logs(tmp_path):
log_file = tmp_path / "test.log"
log_file.write_text("Error: unauthorized access\nAll good\n")
anomalies = detect_anomalies_in_logs(str(log_file))
assert "Error: unauthorized access" in anomalies
setup.py
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setup(
name='ecs-eurocybersecurite',
version='0.3.0',
description='Cybersecurity and AI tools by Eurocybersecurite',
long_description=long_description,
long_description_content_type="text/markdown",
author='Mohamed Redha Abdessemed',
author_email='mohamed.abdessemed@eurocybersecurite.fr',
url='https://github.com/tuteur1/RooR',
project_urls={
"Documentation": "https://eurocybersecurite.fr/auth/login.php",
"Source": "https://github.com/tuteur1/RooR.git",
"Issues": "https://github.com/tuteur1/RooR/issues",
},
license='MIT',
packages=find_packages(),
include_package_data=True,
install_requires=[
"flask",
"transformers",
"torch",
"scikit-learn"
],
entry_points={
'console_scripts': [
'ecs-greet=ecs.core:greet',
],
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Security",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
keywords='cybersecurity, AI, tools, python',
python_requires='>=3.9',
)
pyproject.toml
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
requirements.txt
flask
transformers
torch
scikit-learn
LICENSE
MIT License © Mohamed Redha Abdessemed, Eurocybersecurite
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecs_eurocybersecurite-0.3.4.tar.gz.
File metadata
- Download URL: ecs_eurocybersecurite-0.3.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12c804fd10d2570072caae63f86ad0763e84194e728c53e6c7730ab76da27767
|
|
| MD5 |
051655bccc5303503596fcbf2cece0e9
|
|
| BLAKE2b-256 |
934e5f5ddedbc92b1b435ccfff97a4241045f9d296117ea6e659f59d16e8c368
|
File details
Details for the file ecs_eurocybersecurite-0.3.4-py3-none-any.whl.
File metadata
- Download URL: ecs_eurocybersecurite-0.3.4-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e879dbe19984d60062ea783ba06054d807ffaf953fb2436262e1d2d0034e11a4
|
|
| MD5 |
27dffb30c5589dfbfa57821d5dc2e957
|
|
| BLAKE2b-256 |
48cca92896a466338a7e213c22ae54500fcc847f8c0860d1fa5b7a7a73fc9de8
|