swiftcrypt


Nameswiftcrypt JSON
Version 0.3.5.11 PyPI version JSON
download
home_page
SummarySwiftly Secure your Apps
upload_time2023-08-29 18:40:45
maintainer
docs_urlNone
authorTech Tweaks
requires_python
license
keywords keys passwords crypting encoding secure uuid
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<p align="center">
  <img src="https://raw.githubusercontent.com/Tech-Tweaks/SwiftCrypt/main/swiftCrypt.png" alt="SwiftCrypt Logo">
</p>

<h1 align="center">SwiftCrypt</h1>

<p align="center">
  <b>A Versatile Python module to streamline security tasks, allowing you to concentrate on your core program</b>
</p>

<p align="center">
  <b>Please note: this isn't some new top-notch security, it simply reduces the amount of work you need to put in for security, so you can focus on your actual program!</b>
</p>

<p align="center">
  <a href="https://pypi.org/project/swiftcrypt/"><img src="https://img.shields.io/pypi/status/swiftcrypt" alt="Status"></a>
  <a href="https://www.python.org/downloads/release"><img src="https://img.shields.io/pypi/pyversions/swiftcrypt" alt="Python Version"></a>
  <a href="https://pypi.org/project/swiftcrypt/"><img src="https://img.shields.io/pypi/v/swiftcrypt" alt="Version"></a>
  <a href="https://pypi.org/project/swiftcrypt/"><img src="https://img.shields.io/pypi/dw/swiftcrypt" alt="Downloads"></a>
</p>

#### Documentation isn't out yet. please check the 'swiftcrypt' folder, and each class has its own file explaning the functions!


## Features

- **Secret Generation:** Create random secrets, keys, UUIDs, and passwords using various character sets and customizable configurations.
- **Data Transformation:** Encode and decode data with Base64 and hexadecimal. Securely erase sensitive data using random bytes.
- **Advanced Generation:** Tailor key and password generation with options for uppercase, dual cases, and more.
- **Password Strength Checker:** Evaluate password strength based on length, character types, and more.
- **Password Hashing:** Hash passwords using any algorithm available with advanced salting.
- **Salt Generation:** Generate unique salts for enhanced password security.
- **Two-Factor Authentication (2FA):** Generate QR codes for 2FA setup, verify TOTP codes, and send QR codes via email.
- **Rate Limiting:** Prevent abuse by implementing rate limiting for actions like login attempts.
- **Digital Signature:** Create and verify digital signatures for message authenticity and integrity.
- **Data Masking:** Mask sensitive data such as passwords to enhance security.
- **SecureInputHandler:** This class handles secure database queries, including creating tables, retrieving user information, and executing queries securely.
- **CGSR (Cryptographically:** Secure Random): This class provides a method to generate cryptographically secure random bytes, which can be crucial for creating secure tokens, keys, and other sensitive data.
- **SecureSecretStorage:** This class provides a way to securely store and retrieve secrets, such as usernames and passwords, using the keyring library.
- **SecureSessionManager:** This class manages user sessions securely, creating, validating, and ending sessions while keeping track of timestamps.
- **SecureFileHandler:** Encrypt and upload files securely, as well as download and decrypt files with integrity verification.



## Installation

Install SwiftCrypt using `pip`:

```bash
pip install swiftcrypt
```
# Usage
Here's a quick example of some of the features SwiftCrypt has.

```python
from swiftcrypt import SecretGenerator, Checker, Hash, Salts, fileTransform, rateLimiter

# Create an instance of SecretGenerator
generator = SecretGenerator()

# Generate a secure password
password = generator.generate_password(length=12, numbers=True, special_characters=True)
print("Generated Password:", password)

# Create an instance of Checker
password_checker = Checker()

# Check the strength of a password
strength = password_checker.check_password_strength(password)
print("Password Strength:", strength)

# Create an instance of Hash
hasher = Hash()

# Hash a password with a salt
salt = Salts().generate_salt()
hashed_password = hasher.hash_password(password, salt)
print("Hashed Password:", hashed_password)

# Verify a password against a hashed password
is_verified = password_checker.verify_password(password, hashed_password, salt)
print("Password Verified:", is_verified)



# Create an instance of fileTransform
file_transformer = fileTransform()

# Encrypt a file
file_transformer.encrypt_file("plaintext.txt", "encrypted.bin", password)

# Decrypt the encrypted file
file_transformer.decrypt_file("encrypted.bin", "decrypted.txt", password)


# Create an instance of DataMasking
data_masker = DataMasking()

# Mask sensitive data, such as passwords, to enhance security
original_text = "HelloGuyswelcomeback"
masked_text = data_masker.mask_data(original_text, masking_character="*", chars_to_mask=4)
print("Original Text:", original_text)
print("Masked Text:", masked_text)

# Create an instance of DigitalSignature
digital_signature = DigitalSignature()

# Generate an RSA key pair
private_key, public_key = digital_signature.generate_key_pair()

# Define the message to be signed
message = b"Hello, this is a message."

# Sign the message using the private key
signature = digital_signature.sign_message(private_key, message)

# Verify the signature using the public key and the original message
verification_result = digital_signature.verify_signature(public_key, message, signature)


```

# Using the new 2FA

```python

from swiftcrypt import TwoFactorAuth

two_factor_auth = TwoFactorAuth()

# Generate a secret key for 2FA
user_secret_key = two_factor_auth.generate_secret_key()

# Generate a QR code image for 2FA setup
user_qr_code = two_factor_auth.generate_qr_code(user_secret_key, "user@example.com")

# Send the QR code via email
two_factor_auth.send_qr_code_email(user_qr_code, "user@example.com", "your_email@gmail.com", "your_email_password")

# Print the QR code as a base64-encoded string
two_factor_auth.generate_qr_code_and_print("user@example.com")
```



Check out our documentation for more detailed instructions and examples. [COMING SOON]

# Contribution
We welcome contributions! If you encounter issues or want to enhance SwiftCrypt, please submit a pull request or open an issue.

Discord: https://discord.gg/dtGT6qryUR

# License
SwiftCrypt is licensed under the MIT License.

Feel free to integrate SwiftCrypt into your projects to simplify security tasks and focus on your core development. If you have queries or need assistance, do not hesitate to get in touch.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "swiftcrypt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "keys,passwords,crypting,encoding,secure,uuid",
    "author": "Tech Tweaks",
    "author_email": "tech.tweaks.contact@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8d/e6/da1ba7d7012665be44aec6ba932dd32dea38f2a496419b3b6516f5ee463d/swiftcrypt-0.3.5.11.tar.gz",
    "platform": null,
    "description": "\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/Tech-Tweaks/SwiftCrypt/main/swiftCrypt.png\" alt=\"SwiftCrypt Logo\">\n</p>\n\n<h1 align=\"center\">SwiftCrypt</h1>\n\n<p align=\"center\">\n  <b>A Versatile Python module to streamline security tasks, allowing you to concentrate on your core program</b>\n</p>\n\n<p align=\"center\">\n  <b>Please note: this isn't some new top-notch security, it simply reduces the amount of work you need to put in for security, so you can focus on your actual program!</b>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/swiftcrypt/\"><img src=\"https://img.shields.io/pypi/status/swiftcrypt\" alt=\"Status\"></a>\n  <a href=\"https://www.python.org/downloads/release\"><img src=\"https://img.shields.io/pypi/pyversions/swiftcrypt\" alt=\"Python Version\"></a>\n  <a href=\"https://pypi.org/project/swiftcrypt/\"><img src=\"https://img.shields.io/pypi/v/swiftcrypt\" alt=\"Version\"></a>\n  <a href=\"https://pypi.org/project/swiftcrypt/\"><img src=\"https://img.shields.io/pypi/dw/swiftcrypt\" alt=\"Downloads\"></a>\n</p>\n\n#### Documentation isn't out yet. please check the 'swiftcrypt' folder, and each class has its own file explaning the functions!\n\n\n## Features\n\n- **Secret Generation:** Create random secrets, keys, UUIDs, and passwords using various character sets and customizable configurations.\n- **Data Transformation:** Encode and decode data with Base64 and hexadecimal. Securely erase sensitive data using random bytes.\n- **Advanced Generation:** Tailor key and password generation with options for uppercase, dual cases, and more.\n- **Password Strength Checker:** Evaluate password strength based on length, character types, and more.\n- **Password Hashing:** Hash passwords using any algorithm available with advanced salting.\n- **Salt Generation:** Generate unique salts for enhanced password security.\n- **Two-Factor Authentication (2FA):** Generate QR codes for 2FA setup, verify TOTP codes, and send QR codes via email.\n- **Rate Limiting:** Prevent abuse by implementing rate limiting for actions like login attempts.\n- **Digital Signature:** Create and verify digital signatures for message authenticity and integrity.\n- **Data Masking:** Mask sensitive data such as passwords to enhance security.\n- **SecureInputHandler:** This class handles secure database queries, including creating tables, retrieving user information, and executing queries securely.\n- **CGSR (Cryptographically:** Secure Random): This class provides a method to generate cryptographically secure random bytes, which can be crucial for creating secure tokens, keys, and other sensitive data.\n- **SecureSecretStorage:** This class provides a way to securely store and retrieve secrets, such as usernames and passwords, using the keyring library.\n- **SecureSessionManager:** This class manages user sessions securely, creating, validating, and ending sessions while keeping track of timestamps.\n- **SecureFileHandler:** Encrypt and upload files securely, as well as download and decrypt files with integrity verification.\n\n\n\n## Installation\n\nInstall SwiftCrypt using `pip`:\n\n```bash\npip install swiftcrypt\n```\n# Usage\nHere's a quick example of some of the features SwiftCrypt has.\n\n```python\nfrom swiftcrypt import SecretGenerator, Checker, Hash, Salts, fileTransform, rateLimiter\n\n# Create an instance of SecretGenerator\ngenerator = SecretGenerator()\n\n# Generate a secure password\npassword = generator.generate_password(length=12, numbers=True, special_characters=True)\nprint(\"Generated Password:\", password)\n\n# Create an instance of Checker\npassword_checker = Checker()\n\n# Check the strength of a password\nstrength = password_checker.check_password_strength(password)\nprint(\"Password Strength:\", strength)\n\n# Create an instance of Hash\nhasher = Hash()\n\n# Hash a password with a salt\nsalt = Salts().generate_salt()\nhashed_password = hasher.hash_password(password, salt)\nprint(\"Hashed Password:\", hashed_password)\n\n# Verify a password against a hashed password\nis_verified = password_checker.verify_password(password, hashed_password, salt)\nprint(\"Password Verified:\", is_verified)\n\n\n\n# Create an instance of fileTransform\nfile_transformer = fileTransform()\n\n# Encrypt a file\nfile_transformer.encrypt_file(\"plaintext.txt\", \"encrypted.bin\", password)\n\n# Decrypt the encrypted file\nfile_transformer.decrypt_file(\"encrypted.bin\", \"decrypted.txt\", password)\n\n\n# Create an instance of DataMasking\ndata_masker = DataMasking()\n\n# Mask sensitive data, such as passwords, to enhance security\noriginal_text = \"HelloGuyswelcomeback\"\nmasked_text = data_masker.mask_data(original_text, masking_character=\"*\", chars_to_mask=4)\nprint(\"Original Text:\", original_text)\nprint(\"Masked Text:\", masked_text)\n\n# Create an instance of DigitalSignature\ndigital_signature = DigitalSignature()\n\n# Generate an RSA key pair\nprivate_key, public_key = digital_signature.generate_key_pair()\n\n# Define the message to be signed\nmessage = b\"Hello, this is a message.\"\n\n# Sign the message using the private key\nsignature = digital_signature.sign_message(private_key, message)\n\n# Verify the signature using the public key and the original message\nverification_result = digital_signature.verify_signature(public_key, message, signature)\n\n\n```\n\n# Using the new 2FA\n\n```python\n\nfrom swiftcrypt import TwoFactorAuth\n\ntwo_factor_auth = TwoFactorAuth()\n\n# Generate a secret key for 2FA\nuser_secret_key = two_factor_auth.generate_secret_key()\n\n# Generate a QR code image for 2FA setup\nuser_qr_code = two_factor_auth.generate_qr_code(user_secret_key, \"user@example.com\")\n\n# Send the QR code via email\ntwo_factor_auth.send_qr_code_email(user_qr_code, \"user@example.com\", \"your_email@gmail.com\", \"your_email_password\")\n\n# Print the QR code as a base64-encoded string\ntwo_factor_auth.generate_qr_code_and_print(\"user@example.com\")\n```\n\n\n\nCheck out our documentation for more detailed instructions and examples. [COMING SOON]\n\n# Contribution\nWe welcome contributions! If you encounter issues or want to enhance SwiftCrypt, please submit a pull request or open an issue.\n\nDiscord: https://discord.gg/dtGT6qryUR\n\n# License\nSwiftCrypt is licensed under the MIT License.\n\nFeel free to integrate SwiftCrypt into your projects to simplify security tasks and focus on your core development. If you have queries or need assistance, do not hesitate to get in touch.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Swiftly Secure your Apps",
    "version": "0.3.5.11",
    "project_urls": null,
    "split_keywords": [
        "keys",
        "passwords",
        "crypting",
        "encoding",
        "secure",
        "uuid"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ac15ce79ea475d20b6d56f9d659f95eefb4bb6f987d253dbf305822fb7eb177",
                "md5": "b5e1bdf36718d4cf834a582b9c4bc6aa",
                "sha256": "89976de294a90c74a2cf2e9f88e9f58c34a6f69c9fe4aebf59f70375ba399a75"
            },
            "downloads": -1,
            "filename": "swiftcrypt-0.3.5.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b5e1bdf36718d4cf834a582b9c4bc6aa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9636,
            "upload_time": "2023-08-29T18:40:44",
            "upload_time_iso_8601": "2023-08-29T18:40:44.203712Z",
            "url": "https://files.pythonhosted.org/packages/5a/c1/5ce79ea475d20b6d56f9d659f95eefb4bb6f987d253dbf305822fb7eb177/swiftcrypt-0.3.5.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8de6da1ba7d7012665be44aec6ba932dd32dea38f2a496419b3b6516f5ee463d",
                "md5": "6548b2d1ef14887dcdf1ce612b51f960",
                "sha256": "d5561349bf76ed1805573e4c16622239f53dfd49cbbc15a02cda444db57714e9"
            },
            "downloads": -1,
            "filename": "swiftcrypt-0.3.5.11.tar.gz",
            "has_sig": false,
            "md5_digest": "6548b2d1ef14887dcdf1ce612b51f960",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11439,
            "upload_time": "2023-08-29T18:40:45",
            "upload_time_iso_8601": "2023-08-29T18:40:45.713997Z",
            "url": "https://files.pythonhosted.org/packages/8d/e6/da1ba7d7012665be44aec6ba932dd32dea38f2a496419b3b6516f5ee463d/swiftcrypt-0.3.5.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-29 18:40:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "swiftcrypt"
}
        
Elapsed time: 1.22798s