sheCry


NamesheCry JSON
Version 0.0.22 PyPI version JSON
download
home_pagehttps://hack4tahsin.github.io/
SummarySHE is a hybrid and lightweight cryptography to encrypt and decrypt data for resource-constrained device.
upload_time2023-11-17 22:50:58
maintainer
docs_urlNone
authorTahsin Ahmed
requires_python
license
keywords shecry she cryptography she she encryption she decryption secure hybrid encryption secure hybrid encryption cryptography
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **SHE Cryptography**
========================
The expansion of SHE is **Secure Hybrid Encryption**. It is a cryptographic system that transforms plaintext into ciphertext so that secret communication is ensured through insecure channels like the Internet.

--------------------
**Preface**
--------------------
SHE is a hybrid and lightweight cryptographic concept that ensures faster processing speed along with better security. Theoretically, a hacker needs to go for 2^256 = 1.16e+77 possible ways in terms of finding the correct key to decrypt the ciphertext if the secret key is 256 bits long and secure with a hashing function. It is by far impossible for a regular user device to solve the math. It will be needed a supercomputer to do the computation. However, a low computational powered device (e.g. IOT device) can easily handle it because of its symmetric and stream cipher architecture. Thus, it makes the algorithm faster. Also, SHE is a software and hardware-independent cryptography. Last but not least, as technology is getting revolutionized day by day, it is embracing lightweight and low-powered systems. As a matter of fact, today's cryptography also needs to be lightweight and ensure better security and performance. This is why this new innovation, SHE Cryptography can make a fruitful impact in today’s security epidemic.

--------------------------------
**Project Scenario Problem**
--------------------------------
Nowadays, security has become one of the most burning and sensitive issues. Confidential data is being stolen by malicious attackers rapidly. To prevent this kind of act, many security measures have been established. But “Cryptography” plays the most crucial part when we call for security. This is so because cryptography is used to protect enterprise information and communication from cyber threats through the use of codes. For example, AES and RSA are the gold standards. They are very popular and still vastly used in many renowned organizations as well as in the government. But the drawback is, AES is hardware and software dependent. So, we need to design it according to hardware and software systems. As a result, this implementation increases time and cost. Also, the attacker uses a “Side Channel Attack” to break AES. As a result, it becomes vulnerable. AES performs great in 256 bits keys and is faster in powerful devices. But if it is used in a low computational powered device then we have to use fewer bits (e.g. 64 bits), or the device could not handle the calculation of larger numbers. Thus, AES performs badly in this criterion. If we use fewer bits in AES, then a “Correlation Power Analysis Attack” is possible. So, it is not worth using AES in low computational powered devices. Whereas, RSA is slow due to its large mathematical calculation with large numbers and asymmetric mechanism. As a result, RSA fails to perform in terms of speed and low computational power. Also, the world is switching to lightweight technology day by day. IOT is the best example of it. But to secure those less powerful electronics, there is no such effective cryptographic system yet. Also, breaching the confidential data of the government and the corporate world is a very old topic and it still remains a rapid concern. So, we really need to innovate a new cryptographic algorithm that gives better results in low-power electronics and performs faster, and gives better security in sharing data. This is where lightweight cryptography SHE comes to play.

----------------------------
**Solution Statement**
----------------------------
* **Environment Independency:** SHE is reliable on any platform weather it is for software or hardware. So, developer does not need to hassle with cryptographic system while designing a software or hardware. Thus, it decreases a developer's production time as well.

* **Cost Effectiveness**: In 2007, about 10% of the average IT budget was spent on energy, and energy costs for IT were expected to rise to 50% by 2010. However, the cost of power supply generally depends on the maximum possible power that could be used at any one time. If a CPU needs to calculate a larger number for a cryptographical system, it needs more power and more efficiency to compute in a very short time. As a result, this increases costs most of the time. To reduce cost, many electronic products choose to use a much lighter system. This is where the SHE cryptographic system plays a major role. It reduces the clock rate when it processes large numbers of cryptographical computations. Thus, it reduces cost.

* **Better Security**: No doubt SHE gives better security. It encrypts and decrypts with ChaCha20 algorithm, checks integrity with Poly1305 algorithm and authenticates user with ECDH key exchange protocol. In short, SHE Cryptography completely satisfies the CIA triad of a security system.

* **Faster Speed & Low Latency**: SHE is a stream cipher version of symmetric cryptography. As a result, it encrypts and decrypts the message instantaneously after doing XOR. It can calculate 128 bits and 256 bits easily or sometimes even larger. So, a user should not face any problem if he wants to communicate with others, or wants to download and upload a content.

* **Power Loss Reduction**: CPU gets always hot for its cryptographic system, because this kind of system does massive mathematical computation. As a result, sometimes PSU (Power Supply Unit) could not supply such power that required to perform the task efficiently. So, overloading power causes the systems goes down sometimes or burns the CPU circuit. But the lightweight architecture of SHE, it requires less power to perform its mathematical computation and reduce power loss problems.

--------------------------------
**Ideal Applications To Use**
--------------------------------
* **Low Power Electronics**: Networking devices like PAN, LAN, WAN devices can use this system easily. Not only Mobile but also Watches can use this cryptography efficiently. However, technology like IOT which is one of the most booming electronics nowadays, is also a less power consumption tech product. As a result, it must need lightweight cryptography like SHE to perform securely, faster, and more efficiently without any interruption.

* **Government and Business Communication**: SHE cryptography is applicable to sharing confidential data between government and business agents. This cryptography ensures the total CIA triad (Confidentiality, Integrity and Availability) of security. Also, SHE gives strong protection against malicious attacks (e.g. MITM Attack) because of its ECDH (Elliptic Curve Diffie-Hellman) key exchange protocol. So, this cryptography is reliable in government and business communication.

* **Database Encryption**: In database systems, governments and organizations rely on vendors, but there is no guarantee that the data is protected. SHE can be implemented to store data into ciphertext with the ECDH protocol. As a result, any unauthorized person or third party organization won’t be able to use our confidential data unethically.

* **Banking**: Many online banking and payment applications require the verification of personally identifiable information before proceeding with their transactions. It helps in predicting the correct information to prevent fraudulent activities and cybercrime. This is where SHE can easily authenticate users in the money transaction system, such as credit or debit card transactions or online banking sessions.

----------------------------
**Installation**
----------------------------
To install this project in your local server -

    pip install sheCry

----------------------------
**Usage / Example**
----------------------------
This is an example how you can write your code so that it runs successfully.

    # We will fetch crypto class from sheCry package

    from sheCry import crypto

    
    # We will input the length of the shared key that the sender and receiver will share with each other for communication

    sharedKey = int(input("Key length for shared key value: "))

    
    # We will input the length of the private key which must remain secret

    privateKey = int(input("Key length for private key: "))

    
    # We will enter the message to send it to the receiver

    message = input("Enter message: ")
    

    # Now we will call crypto() and make it a class variable

    she = crypto()
    

    # We will call key() method and insert our sharedKey and privateKey

    she.key(sharedKey, privateKey)
    

    # Now, it's time to encrypt the message and print the ciphertext

    ciphertext = she.encrypt(message)

    print("Ciphertext:", ciphertext)

    # In authentication, the sender key and receiver key must be matched

    if she.auth() is True:

        # Plaintext will be revealed if the sender key and receiver key are matched

        plaintext = she.decrypt()

        print("Plaintext:", plaintext)

        # show() method will present all the execution steps

        she.show()

    else:

        print("Authentication failed!")

----------------------------
**Program Utilization**
----------------------------
* A user inputs the length of private keys and generated shared keys.
* A user inputs message.
* Generates prime number according to Fermat Prime Number Theorem.
* Generates private key.
* Generates public key according to private key.
* Diffie-Hellman key exchange protocol is used for authenticity checking, where a sender locks the message with a receiver's public key and the receiver unlocks it with his private key.
* The message is encrypted and decrypted by ChaCha20 algorithm.
* Poly1305 algorithm has been used for integrity checking.

--------------------------------
**Caution**
--------------------------------
* Know SHE Cryptography properly through the documentation before using it.
* Anyone can use this cryptography for free only for education, research, and development purpose.
* SHE is absolutely not for unethical motives. Creator will not be found guilty if anyone uses this for illegal purpose.

--------------------------------
**Do You Want To Know Me?**
--------------------------------
* **Call**: +8801818832925
* **Email**: tahsin.ahmed@g.bracu.ac.bd
* **Social Media**: https://www.facebook.com/ahmedinsider

            

Raw data

            {
    "_id": null,
    "home_page": "https://hack4tahsin.github.io/",
    "name": "sheCry",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "sheCry,SHE cryptography,SHE,SHE encryption,SHE decryption,Secure Hybrid Encryption,Secure Hybrid Encryption cryptography",
    "author": "Tahsin Ahmed",
    "author_email": "t.ahmed@cyberengine.org",
    "download_url": "https://files.pythonhosted.org/packages/62/7d/a8a0bec363a88750d6517fcb8c7c5a10d37f546217b71898b663822106d7/sheCry-0.0.22.tar.gz",
    "platform": null,
    "description": "**SHE Cryptography**\r\n========================\r\nThe expansion of SHE is **Secure Hybrid Encryption**. It is a cryptographic system that transforms plaintext into ciphertext so that secret communication is ensured through insecure channels like the Internet.\r\n\r\n--------------------\r\n**Preface**\r\n--------------------\r\nSHE is a hybrid and lightweight cryptographic concept that ensures faster processing speed along with better security. Theoretically, a hacker needs to go for 2^256 = 1.16e+77 possible ways in terms of finding the correct key to decrypt the ciphertext if the secret key is 256 bits long and secure with a hashing function. It is by far impossible for a regular user device to solve the math. It will be needed a supercomputer to do the computation. However, a low computational powered device (e.g. IOT device) can easily handle it because of its symmetric and stream cipher architecture. Thus, it makes the algorithm faster. Also, SHE is a software and hardware-independent cryptography. Last but not least, as technology is getting revolutionized day by day, it is embracing lightweight and low-powered systems. As a matter of fact, today's cryptography also needs to be lightweight and ensure better security and performance. This is why this new innovation, SHE Cryptography can make a fruitful impact in today\u2019s security epidemic.\r\n\r\n--------------------------------\r\n**Project Scenario Problem**\r\n--------------------------------\r\nNowadays, security has become one of the most burning and sensitive issues. Confidential data is being stolen by malicious attackers rapidly. To prevent this kind of act, many security measures have been established. But \u201cCryptography\u201d plays the most crucial part when we call for security. This is so because cryptography is used to protect enterprise information and communication from cyber threats through the use of codes. For example, AES and RSA are the gold standards. They are very popular and still vastly used in many renowned organizations as well as in the government. But the drawback is, AES is hardware and software dependent. So, we need to design it according to hardware and software systems. As a result, this implementation increases time and cost. Also, the attacker uses a \u201cSide Channel Attack\u201d to break AES. As a result, it becomes vulnerable. AES performs great in 256 bits keys and is faster in powerful devices. But if it is used in a low computational powered device then we have to use fewer bits (e.g. 64 bits), or the device could not handle the calculation of larger numbers. Thus, AES performs badly in this criterion. If we use fewer bits in AES, then a \u201cCorrelation Power Analysis Attack\u201d is possible. So, it is not worth using AES in low computational powered devices. Whereas, RSA is slow due to its large mathematical calculation with large numbers and asymmetric mechanism. As a result, RSA fails to perform in terms of speed and low computational power. Also, the world is switching to lightweight technology day by day. IOT is the best example of it. But to secure those less powerful electronics, there is no such effective cryptographic system yet. Also, breaching the confidential data of the government and the corporate world is a very old topic and it still remains a rapid concern. So, we really need to innovate a new cryptographic algorithm that gives better results in low-power electronics and performs faster, and gives better security in sharing data. This is where lightweight cryptography SHE comes to play.\r\n\r\n----------------------------\r\n**Solution Statement**\r\n----------------------------\r\n* **Environment Independency:** SHE is reliable on any platform weather it is for software or hardware. So, developer does not need to hassle with cryptographic system while designing a software or hardware. Thus, it decreases a developer's production time as well.\r\n\r\n* **Cost Effectiveness**: In 2007, about 10% of the average IT budget was spent on energy, and energy costs for IT were expected to rise to 50% by 2010. However, the cost of power supply generally depends on the maximum possible power that could be used at any one time. If a CPU needs to calculate a larger number for a cryptographical system, it needs more power and more efficiency to compute in a very short time. As a result, this increases costs most of the time. To reduce cost, many electronic products choose to use a much lighter system. This is where the SHE cryptographic system plays a major role. It reduces the clock rate when it processes large numbers of cryptographical computations. Thus, it reduces cost.\r\n\r\n* **Better Security**: No doubt SHE gives better security. It encrypts and decrypts with ChaCha20 algorithm, checks integrity with Poly1305 algorithm and authenticates user with ECDH key exchange protocol. In short, SHE Cryptography completely satisfies the CIA triad of a security system.\r\n\r\n* **Faster Speed & Low Latency**: SHE is a stream cipher version of symmetric cryptography. As a result, it encrypts and decrypts the message instantaneously after doing XOR. It can calculate 128 bits and 256 bits easily or sometimes even larger. So, a user should not face any problem if he wants to communicate with others, or wants to download and upload a content.\r\n\r\n* **Power Loss Reduction**: CPU gets always hot for its cryptographic system, because this kind of system does massive mathematical computation. As a result, sometimes PSU (Power Supply Unit) could not supply such power that required to perform the task efficiently. So, overloading power causes the systems goes down sometimes or burns the CPU circuit. But the lightweight architecture of SHE, it requires less power to perform its mathematical computation and reduce power loss problems.\r\n\r\n--------------------------------\r\n**Ideal Applications To Use**\r\n--------------------------------\r\n* **Low Power Electronics**: Networking devices like PAN, LAN, WAN devices can use this system easily. Not only Mobile but also Watches can use this cryptography efficiently. However, technology like IOT which is one of the most booming electronics nowadays, is also a less power consumption tech product. As a result, it must need lightweight cryptography like SHE to perform securely, faster, and more efficiently without any interruption.\r\n\r\n* **Government and Business Communication**: SHE cryptography is applicable to sharing confidential data between government and business agents. This cryptography ensures the total CIA triad (Confidentiality, Integrity and Availability) of security. Also, SHE gives strong protection against malicious attacks (e.g. MITM Attack) because of its ECDH (Elliptic Curve Diffie-Hellman) key exchange protocol. So, this cryptography is reliable in government and business communication.\r\n\r\n* **Database Encryption**: In database systems, governments and organizations rely on vendors, but there is no guarantee that the data is protected. SHE can be implemented to store data into ciphertext with the ECDH protocol. As a result, any unauthorized person or third party organization won\u2019t be able to use our confidential data unethically.\r\n\r\n* **Banking**: Many online banking and payment applications require the verification of personally identifiable information before proceeding with their transactions. It helps in predicting the correct information to prevent fraudulent activities and cybercrime. This is where SHE can easily authenticate users in the money transaction system, such as credit or debit card transactions or online banking sessions.\r\n\r\n----------------------------\r\n**Installation**\r\n----------------------------\r\nTo install this project in your local server -\r\n\r\n    pip install sheCry\r\n\r\n----------------------------\r\n**Usage / Example**\r\n----------------------------\r\nThis is an example how you can write your code so that it runs successfully.\r\n\r\n    # We will fetch crypto class from sheCry package\r\n\r\n    from sheCry import crypto\r\n\r\n    \r\n    # We will input the length of the shared key that the sender and receiver will share with each other for communication\r\n\r\n    sharedKey = int(input(\"Key length for shared key value: \"))\r\n\r\n    \r\n    # We will input the length of the private key which must remain secret\r\n\r\n    privateKey = int(input(\"Key length for private key: \"))\r\n\r\n    \r\n    # We will enter the message to send it to the receiver\r\n\r\n    message = input(\"Enter message: \")\r\n    \r\n\r\n    # Now we will call crypto() and make it a class variable\r\n\r\n    she = crypto()\r\n    \r\n\r\n    # We will call key() method and insert our sharedKey and privateKey\r\n\r\n    she.key(sharedKey, privateKey)\r\n    \r\n\r\n    # Now, it's time to encrypt the message and print the ciphertext\r\n\r\n    ciphertext = she.encrypt(message)\r\n\r\n    print(\"Ciphertext:\", ciphertext)\r\n\r\n    # In authentication, the sender key and receiver key must be matched\r\n\r\n    if she.auth() is True:\r\n\r\n        # Plaintext will be revealed if the sender key and receiver key are matched\r\n\r\n        plaintext = she.decrypt()\r\n\r\n        print(\"Plaintext:\", plaintext)\r\n\r\n        # show() method will present all the execution steps\r\n\r\n        she.show()\r\n\r\n    else:\r\n\r\n        print(\"Authentication failed!\")\r\n\r\n----------------------------\r\n**Program Utilization**\r\n----------------------------\r\n* A user inputs the length of private keys and generated shared keys.\r\n* A user inputs message.\r\n* Generates prime number according to Fermat Prime Number Theorem.\r\n* Generates private key.\r\n* Generates public key according to private key.\r\n* Diffie-Hellman key exchange protocol is used for authenticity checking, where a sender locks the message with a receiver's public key and the receiver unlocks it with his private key.\r\n* The message is encrypted and decrypted by ChaCha20 algorithm.\r\n* Poly1305 algorithm has been used for integrity checking.\r\n\r\n--------------------------------\r\n**Caution**\r\n--------------------------------\r\n* Know SHE Cryptography properly through the documentation before using it.\r\n* Anyone can use this cryptography for free only for education, research, and development purpose.\r\n* SHE is absolutely not for unethical motives. Creator will not be found guilty if anyone uses this for illegal purpose.\r\n\r\n--------------------------------\r\n**Do You Want To Know Me?**\r\n--------------------------------\r\n* **Call**: +8801818832925\r\n* **Email**: tahsin.ahmed@g.bracu.ac.bd\r\n* **Social Media**: https://www.facebook.com/ahmedinsider\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "SHE is a hybrid and lightweight cryptography to encrypt and decrypt data for resource-constrained device.",
    "version": "0.0.22",
    "project_urls": {
        "Homepage": "https://hack4tahsin.github.io/"
    },
    "split_keywords": [
        "shecry",
        "she cryptography",
        "she",
        "she encryption",
        "she decryption",
        "secure hybrid encryption",
        "secure hybrid encryption cryptography"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07e526ea6d8c462a2a00d15b7267625e305a00d89b426757184c01a8608de6e3",
                "md5": "5f771863ca4a358bcdd8c5dbcb95d712",
                "sha256": "d44543c89e1d1119d86806ef733e2454a4e5c7a19e912b42adf48c9e16bd7887"
            },
            "downloads": -1,
            "filename": "sheCry-0.0.22-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f771863ca4a358bcdd8c5dbcb95d712",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 17749,
            "upload_time": "2023-11-17T22:50:56",
            "upload_time_iso_8601": "2023-11-17T22:50:56.599063Z",
            "url": "https://files.pythonhosted.org/packages/07/e5/26ea6d8c462a2a00d15b7267625e305a00d89b426757184c01a8608de6e3/sheCry-0.0.22-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "627da8a0bec363a88750d6517fcb8c7c5a10d37f546217b71898b663822106d7",
                "md5": "cffdf0fc1cb94ca04e2881601c75dd99",
                "sha256": "e8676207222380ac4f24b23978ee9a00ff8732b22c5576b42717c863be0f7dc1"
            },
            "downloads": -1,
            "filename": "sheCry-0.0.22.tar.gz",
            "has_sig": false,
            "md5_digest": "cffdf0fc1cb94ca04e2881601c75dd99",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17714,
            "upload_time": "2023-11-17T22:50:58",
            "upload_time_iso_8601": "2023-11-17T22:50:58.348640Z",
            "url": "https://files.pythonhosted.org/packages/62/7d/a8a0bec363a88750d6517fcb8c7c5a10d37f546217b71898b663822106d7/sheCry-0.0.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-17 22:50:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "shecry"
}
        
Elapsed time: 0.17178s