sessionless


Namesessionless JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummarySessionless is an attempt to make authentication handling easier for developers without traditional sessions.
upload_time2024-04-28 14:24:40
maintainerNone
docs_urlNone
authorSessionless Team
requires_pythonNone
licenseNone
keywords authentication cryptography authenticate
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
    <h1> Sessionless : Python</h1>
</div>

## About

[Sessionless](https://sessionless.org/) is an open-source authentication protocol that uses the cryptography employed by Bitcoin and Ethereum to authenticate messages sent between a client and a server. Within this protocol, you create and store a private key on the client and then use that key to sign messages; the server then verifies those messages via the public key associated with the client. When you verify a message you also certify its provenance. Sessions are wholly unnecessary because no other secret needs to be shared between client and server.

## Getting Started 

To install the package, run the following code within your command line interface. More information regarding release history for this package can be found [here](https://pypi.org/project/sessionless/).
```
pip install sessionless
```

## Development 

### Getting started
To use this package, please call a new instance of the SessionlessSecp256k1 class. Users will need to provide a get key method. This method will be referenced later on to obtain key values.

```python
# This will create an instance of the SessionlessSecp256k1 class 

sessionless = SessionlessSecp256k1()
```

### Generating private and public keys
The generate keys method will generate a unique private key and a public key. To use the method, users must provide a method to save the keys. This function to save the keys is left to the user's implementation.
```python
# The defined function will be called upon to store the generated keys
def saveKey(keyPair):
    db.store(keyPair["privateKey"], keyPair["publicKey"])
private_key, public_key = sessionless.generateKeys(saveKey) 
```

### Signing messages
Users can easily sign messages by providing a message to the sign method and a callable method that will return the private key. Messages do not need to be encoded before passing them to the method. The method will return an encrypted signature that users can store as needed. The method to the get the key is left to the user's implementation.
```python
# The defined method to get the keys will be called to retrieve the private key
msg = {
"message": "The weather is so nice today!"
}
signature = sessionless.sign(msg, getKey(privateKey={}))
```

### Verifying messages
Users can verify messages and signatures to ensure data integrity, authenticity, and non-repudiation. Users will pass a signature, message, and an encrypted public key as parameters. If public key is not provided, a public key will be generated from the instance's private key.
```python
result = sessionless.verifySignature(signature, msg, public_key) # Returns True
result2 = sessionless.verifySignature(first_signature, first_msg, second_primary_key) # Returns False
```

### Associating messages
Users can verify that two messages can be associated using the associate method. 
```python
result = sessionless.associate(primary_sig, primary_msg, primary_public_key, secondary_sig, secondary_msg, secondary_public_key) # Returns either True or False

```

### Generating UUIDs [Universally Unique Identifiers]
Users can generate unique identifiers as needed by calling the generate UUID method.
```python
uuid = sessionless.generateUUID() # Returns UUID

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sessionless",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "authentication, cryptography, authenticate",
    "author": "Sessionless Team",
    "author_email": "zach@planetnine.app",
    "download_url": "https://files.pythonhosted.org/packages/ff/6d/265f5a9c7931d0627da305120879e564654d75dc799507cc3d0da5eb4cd0/sessionless-0.0.4.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <h1> Sessionless : Python</h1>\n</div>\n\n## About\n\n[Sessionless](https://sessionless.org/) is an open-source authentication protocol that uses the cryptography employed by Bitcoin and Ethereum to authenticate messages sent between a client and a server. Within this protocol, you create and store a private key on the client and then use that key to sign messages; the server then verifies those messages via the public key associated with the client. When you verify a message you also certify its provenance. Sessions are wholly unnecessary because no other secret needs to be shared between client and server.\n\n## Getting Started \n\nTo install the package, run the following code within your command line interface. More information regarding release history for this package can be found [here](https://pypi.org/project/sessionless/).\n```\npip install sessionless\n```\n\n## Development \n\n### Getting started\nTo use this package, please call a new instance of the SessionlessSecp256k1 class. Users will need to provide a get key method. This method will be referenced later on to obtain key values.\n\n```python\n# This will create an instance of the SessionlessSecp256k1 class \n\nsessionless = SessionlessSecp256k1()\n```\n\n### Generating private and public keys\nThe generate keys method will generate a unique private key and a public key. To use the method, users must provide a method to save the keys. This function to save the keys is left to the user's implementation.\n```python\n# The defined function will be called upon to store the generated keys\ndef saveKey(keyPair):\n    db.store(keyPair[\"privateKey\"], keyPair[\"publicKey\"])\nprivate_key, public_key = sessionless.generateKeys(saveKey) \n```\n\n### Signing messages\nUsers can easily sign messages by providing a message to the sign method and a callable method that will return the private key. Messages do not need to be encoded before passing them to the method. The method will return an encrypted signature that users can store as needed. The method to the get the key is left to the user's implementation.\n```python\n# The defined method to get the keys will be called to retrieve the private key\nmsg = {\n\"message\": \"The weather is so nice today!\"\n}\nsignature = sessionless.sign(msg, getKey(privateKey={}))\n```\n\n### Verifying messages\nUsers can verify messages and signatures to ensure data integrity, authenticity, and non-repudiation. Users will pass a signature, message, and an encrypted public key as parameters. If public key is not provided, a public key will be generated from the instance's private key.\n```python\nresult = sessionless.verifySignature(signature, msg, public_key) # Returns True\nresult2 = sessionless.verifySignature(first_signature, first_msg, second_primary_key) # Returns False\n```\n\n### Associating messages\nUsers can verify that two messages can be associated using the associate method. \n```python\nresult = sessionless.associate(primary_sig, primary_msg, primary_public_key, secondary_sig, secondary_msg, secondary_public_key) # Returns either True or False\n\n```\n\n### Generating UUIDs [Universally Unique Identifiers]\nUsers can generate unique identifiers as needed by calling the generate UUID method.\n```python\nuuid = sessionless.generateUUID() # Returns UUID\n\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Sessionless is an attempt to make authentication handling easier for developers without traditional sessions.",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [
        "authentication",
        " cryptography",
        " authenticate"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0405439a7292d091c63799acb661c4287707fecee69f763743cfacf8789b15f",
                "md5": "5ba42b637a387398e659d764f9594d05",
                "sha256": "316dba21ced9bdf7c8c2fa88a1288821dffb333bc12b2ef037ae8fd8eaeaa7b4"
            },
            "downloads": -1,
            "filename": "sessionless-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5ba42b637a387398e659d764f9594d05",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4770,
            "upload_time": "2024-04-28T14:24:39",
            "upload_time_iso_8601": "2024-04-28T14:24:39.325438Z",
            "url": "https://files.pythonhosted.org/packages/d0/40/5439a7292d091c63799acb661c4287707fecee69f763743cfacf8789b15f/sessionless-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff6d265f5a9c7931d0627da305120879e564654d75dc799507cc3d0da5eb4cd0",
                "md5": "3456322534b3f66ac0879709f9bd4896",
                "sha256": "f9880f0a29765cb6b4b0c28b360db7241999a795f17a486a4c2cfb95d6ad1a1f"
            },
            "downloads": -1,
            "filename": "sessionless-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "3456322534b3f66ac0879709f9bd4896",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4354,
            "upload_time": "2024-04-28T14:24:40",
            "upload_time_iso_8601": "2024-04-28T14:24:40.965472Z",
            "url": "https://files.pythonhosted.org/packages/ff/6d/265f5a9c7931d0627da305120879e564654d75dc799507cc3d0da5eb4cd0/sessionless-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 14:24:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "sessionless"
}
        
Elapsed time: 0.24007s