crypto-otrs


Namecrypto-otrs JSON
Version 1.0.8 PyPI version JSON
download
home_page
SummaryOne-time Traceable Ring Signature of Alessandra Scafuro and Bihan Zhang implemented by @NickP05
upload_time2023-01-02 17:30:45
maintainer
docs_urlNone
author
requires_python>=3.6.9
license
keywords cryptography ring signature otrs quantum-resistant
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # crypto-otrs: One-time Traceable Ring Signature
```
pip3 install crypto-otrs
```


Based on the [the work of Alessandra Scafuro and Bihan Zhang](https://eprint.iacr.org/2021/1054.pdf) of the Nord Carolina State University.  
Use this at your own risk. This is a python library that wraps the C code you can find at my github [github.com/NickP005/my-cryptography](https://github.com/NickP005/my-cryptography). 
Quantum-resistant, speedy, black-box, random oracle

## What is a ring signature
A ring signature is a cryptographic signature scheme that can be signed by any member of a group of users (AKA "ring"). The signer produces a signature on the message that proves the message has been signed by one of the group members, but it is impossible to know certainly who.
    
For example: during the meeting of Pear's shareholders (Luca, Matteo and Lucia), each shareholder is asked to vote anonymously on the increase in payrool of the employees. Looking just to Luca (but the other members will do the same): Luca generates a keypair and publishes it to the world. Then, after Luca gets Matteo and Lucia's ones, he makes signs the message "I approve to increase payrool at date XX/XX/XXXX" on behalf of the ring of public keys (Luca, Matteo, Lucia). Then they anonymously submit the signatures to a notary that looking at the signature, cannot deduce anything except that the signer could be with equal probability Luca as well as Matteo as well as Lucia.  
This scheme is traceable in the sense that if Matteo wanted to cheat (give more weight to his opinion) and signs 2 messages, the notary will be able to trace back, given the 2 messages, to Matteo's public key.

Pay attention that the public/private keypair is throwaway and **must be used once** (recall: one time). Only one message is signable at time.

## How to use
Below some example usage

### Create a keypair
```
from crypto_otrs import ring

public_key, private_key = ring.keygen()
```

### Sign a message
```
from crypto_otrs import ring

bob_public, bob_private = ring.keygen()
alice_public, alice_private = ring.keygen()

ring = []
ring.append(bob_public)
ring.append(alice_public)

# here Alice signs pasta vs pizza feud
# position of Alice's public key is 1
alice_signature = ring.RSign(ring, alice_private, 1, b"pizza is the besta food of the world")
```

### Verify a signature
now someone gets a "signature", the public keys (MUST BE IN ORDER!) of it and the message:
```
from crypto_otrs import ring

is_valid = ring.RVer(ring, b"pizza is the besta food of the world", signature) 
# --> True or False
```

### Trace a signature
We don't know if Bob voted yet or is still playing video games, but we got 2 signatures... let's check if Alice cheated (Alice likes to cheat often):
```
from crypto_otrs import ring

is_from_same_signer, traced_public_key = ring.RTrace(ring, signature_1, signature_2)
# --> True, alice_public
# ...Alice cheated
```

## Technical overview
### keygen() 
`public_key[768], private_key[512] = ring.keygen()`  
returns a public/private keypair tuple stored in the form of uint_8 arrays.
### RSign() 
`signature[SIG_LEN] = ring.RSign(ring, private_key, position, message)`  
where `SIG_LEN = N*256 + N*16`  
generates a signature in the form of a uint_8 array. Takes in the array of public keys of the ring, the private key, the position of the public key in the ring (start from 0) and a message that should be in the form of bytes.
### RVer() 
`is_valid = RVer(ring, message, signature)`  
outputs `True` when the signature is valid, `False` otherwise.  
Takes in the array of public keys (ring), the message (as said before, in bytes) and the signature.
### RTrace() 
`traces, traced = RTrace(ring, signature_1, signature_2)`  
outputs a tuple where the first element is a boolean that outputs `True` when the two signatures came from the same private key. In this case the `traced` variable is equal to the public key of the traced signature.

## Performance
I didn't test python ones, since it is a wrapper, should be te same as [github.com/NickP005/my-cryptography](https://github.com/NickP005/my-cryptography)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "crypto-otrs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6.9",
    "maintainer_email": "",
    "keywords": "cryptography,ring,signature,otrs,quantum-resistant",
    "author": "",
    "author_email": "One Time Traceable Ring Signature <truestop16@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/23/8e/cb2413173d6b870dc6595afc416593d0c3fcb66ef10973d8b45225035200/crypto_otrs-1.0.8.tar.gz",
    "platform": null,
    "description": "# crypto-otrs: One-time Traceable Ring Signature\n```\npip3 install crypto-otrs\n```\n\n\nBased on the [the work of Alessandra Scafuro and Bihan Zhang](https://eprint.iacr.org/2021/1054.pdf) of the Nord Carolina State University.  \nUse this at your own risk. This is a python library that wraps the C code you can find at my github [github.com/NickP005/my-cryptography](https://github.com/NickP005/my-cryptography). \nQuantum-resistant, speedy, black-box, random oracle\n\n## What is a ring signature\nA ring signature is a cryptographic signature scheme that can be signed by any member of a group of users (AKA \"ring\"). The signer produces a signature on the message that proves the message has been signed by one of the group members, but it is impossible to know certainly who.\n    \nFor example: during the meeting of Pear's shareholders (Luca, Matteo and Lucia), each shareholder is asked to vote anonymously on the increase in payrool of the employees. Looking just to Luca (but the other members will do the same): Luca generates a keypair and publishes it to the world. Then, after Luca gets Matteo and Lucia's ones, he makes signs the message \"I approve to increase payrool at date XX/XX/XXXX\" on behalf of the ring of public keys (Luca, Matteo, Lucia). Then they anonymously submit the signatures to a notary that looking at the signature, cannot deduce anything except that the signer could be with equal probability Luca as well as Matteo as well as Lucia.  \nThis scheme is traceable in the sense that if Matteo wanted to cheat (give more weight to his opinion) and signs 2 messages, the notary will be able to trace back, given the 2 messages, to Matteo's public key.\n\nPay attention that the public/private keypair is throwaway and **must be used once** (recall: one time). Only one message is signable at time.\n\n## How to use\nBelow some example usage\n\n### Create a keypair\n```\nfrom crypto_otrs import ring\n\npublic_key, private_key = ring.keygen()\n```\n\n### Sign a message\n```\nfrom crypto_otrs import ring\n\nbob_public, bob_private = ring.keygen()\nalice_public, alice_private = ring.keygen()\n\nring = []\nring.append(bob_public)\nring.append(alice_public)\n\n# here Alice signs pasta vs pizza feud\n# position of Alice's public key is 1\nalice_signature = ring.RSign(ring, alice_private, 1, b\"pizza is the besta food of the world\")\n```\n\n### Verify a signature\nnow someone gets a \"signature\", the public keys (MUST BE IN ORDER!) of it and the message:\n```\nfrom crypto_otrs import ring\n\nis_valid = ring.RVer(ring, b\"pizza is the besta food of the world\", signature) \n# --> True or False\n```\n\n### Trace a signature\nWe don't know if Bob voted yet or is still playing video games, but we got 2 signatures... let's check if Alice cheated (Alice likes to cheat often):\n```\nfrom crypto_otrs import ring\n\nis_from_same_signer, traced_public_key = ring.RTrace(ring, signature_1, signature_2)\n# --> True, alice_public\n# ...Alice cheated\n```\n\n## Technical overview\n### keygen() \n`public_key[768], private_key[512] = ring.keygen()`  \nreturns a public/private keypair tuple stored in the form of uint_8 arrays.\n### RSign() \n`signature[SIG_LEN] = ring.RSign(ring, private_key, position, message)`  \nwhere `SIG_LEN = N*256 + N*16`  \ngenerates a signature in the form of a uint_8 array. Takes in the array of public keys of the ring, the private key, the position of the public key in the ring (start from 0) and a message that should be in the form of bytes.\n### RVer() \n`is_valid = RVer(ring, message, signature)`  \noutputs `True` when the signature is valid, `False` otherwise.  \nTakes in the array of public keys (ring), the message (as said before, in bytes) and the signature.\n### RTrace() \n`traces, traced = RTrace(ring, signature_1, signature_2)`  \noutputs a tuple where the first element is a boolean that outputs `True` when the two signatures came from the same private key. In this case the `traced` variable is equal to the public key of the traced signature.\n\n## Performance\nI didn't test python ones, since it is a wrapper, should be te same as [github.com/NickP005/my-cryptography](https://github.com/NickP005/my-cryptography)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "One-time Traceable Ring Signature of Alessandra Scafuro and Bihan Zhang implemented by @NickP05",
    "version": "1.0.8",
    "split_keywords": [
        "cryptography",
        "ring",
        "signature",
        "otrs",
        "quantum-resistant"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e2846ab52143038d4c5614f7842bdb2717234fcff46006c905d2c5e53a10834",
                "md5": "3d157bc773bfbdbca8b82ee731fb46cc",
                "sha256": "e5fcefe5a84a527c196401a2e50c270a9dba911e1d23f7f8cc70caf313319168"
            },
            "downloads": -1,
            "filename": "crypto_otrs-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3d157bc773bfbdbca8b82ee731fb46cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6.9",
            "size": 13663,
            "upload_time": "2023-01-02T17:30:43",
            "upload_time_iso_8601": "2023-01-02T17:30:43.294863Z",
            "url": "https://files.pythonhosted.org/packages/1e/28/46ab52143038d4c5614f7842bdb2717234fcff46006c905d2c5e53a10834/crypto_otrs-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "238ecb2413173d6b870dc6595afc416593d0c3fcb66ef10973d8b45225035200",
                "md5": "d82ea076cd88aace31c03621d7768531",
                "sha256": "8e8535f803a8ec8cc35e8ed1d0a6d1eb8bdc7d24be38faaf1d96176d9f137600"
            },
            "downloads": -1,
            "filename": "crypto_otrs-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "d82ea076cd88aace31c03621d7768531",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.9",
            "size": 13204,
            "upload_time": "2023-01-02T17:30:45",
            "upload_time_iso_8601": "2023-01-02T17:30:45.214525Z",
            "url": "https://files.pythonhosted.org/packages/23/8e/cb2413173d6b870dc6595afc416593d0c3fcb66ef10973d8b45225035200/crypto_otrs-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-02 17:30:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "crypto-otrs"
}
        
Elapsed time: 0.02390s