Unified Resource for Cryptographic Arrays
Project description
URCA
Unified Resource for Cryptographic Arrays
The URCA project aims to give the vectorized implementations of many cryptographic primitives in order to investigate the statistical properties. Not only, since sometimes it could be useful to study a reduced version of the primitives, the URCA project tries to give the generalised version of the primitives. The project implements vectorised implementations both for CPUs and GPUs, using respectvely NumPy and CuPy.
Pages
Examples
Multiple plaintext can be encrypted at once.
>>> import numpy as np
>>> from urca.cpu.blocks.speck import Speck
>>> speck = Speck(32, 64)
>>> word_type = speck.word_type
>>> texts = np.array([[0x6574, 0x694C], [0x0000, 0x0000]], dtype=word_type)
>>> keys = np.array([[0x1918, 0x1110, 0x0908, 0x0100], [0x0000, 0x0000, 0x0000, 0x0000]], dtype=word_type)
>>> speck.encrypt(texts, keys, 0, 22)
>>> np.vectorize(hex)(texts)
array([['0xa868', '0x42f2'],
['0x2bb9', '0xc642']], dtype='<U6')
URCA is designed to be as general as possible. The following workflow, encrypting a bunch of texts, can be applied to any primitive.
>>> import random
>>> import numpy as np
>>> from urca.cpu.blocks.speck import Speck
>>> primitive = Speck(32, 64)
>>> word_size = primitive.word_size
>>> word_type = primitive.word_type
>>> n_text_words = primitive.n_text_words
>>> n_key_words = primitive.n_key_words
>>> n_instances = 4
>>> texts = [[random.getrandbits(word_size) for _ in range(n_text_words)] for _ in range(n_instances)]
>>> texts = np.array(texts, dtype=word_type)
>>> keys = [[random.getrandbits(word_size) for _ in range(n_key_words)] for _ in range(n_instances)]
>>> keys = np.array(keys, dtype=word_type)
>>> primitive.encrypt(texts, keys, 0, 22)
>>> np.vectorize(hex)(texts)
# array([['0x3068', '0xc0bf'],
# ['0xb30b', '0xbed8'],
# ['0xbb16', '0xece6'],
# ['0x921a', '0x6f0a']], dtype='<U6')
# Example of output
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 urca-1.0.0.tar.gz.
File metadata
- Download URL: urca-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
137d63f0999b7bb50f4dbcb917122a991c480d76012e432f70955bcf7586355b
|
|
| MD5 |
d3396073b0b10044e7d57a73933d539d
|
|
| BLAKE2b-256 |
ef7a23fd4d76478df899356605f902f1b3692b8c6b402843266733cbdbb249d3
|
Provenance
The following attestation bundles were made for urca-1.0.0.tar.gz:
Publisher:
release.yml on ale-depi/urca
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
urca-1.0.0.tar.gz -
Subject digest:
137d63f0999b7bb50f4dbcb917122a991c480d76012e432f70955bcf7586355b - Sigstore transparency entry: 460033457
- Sigstore integration time:
-
Permalink:
ale-depi/urca@b93016eac6b14e7d3b7108ed7518cba6f78c8104 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/ale-depi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b93016eac6b14e7d3b7108ed7518cba6f78c8104 -
Trigger Event:
release
-
Statement type:
File details
Details for the file urca-1.0.0-py3-none-any.whl.
File metadata
- Download URL: urca-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4e0c3a23acec7f550652cb80f80340e667e19a6b02e76caddac52b37da26b80
|
|
| MD5 |
54a68aa1e94a0ea16bbb5fc1bb0fabad
|
|
| BLAKE2b-256 |
929e6507437abec4e3f6138468e6353696a575f18777fb2c4697acdcaebe86ae
|
Provenance
The following attestation bundles were made for urca-1.0.0-py3-none-any.whl:
Publisher:
release.yml on ale-depi/urca
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
urca-1.0.0-py3-none-any.whl -
Subject digest:
b4e0c3a23acec7f550652cb80f80340e667e19a6b02e76caddac52b37da26b80 - Sigstore transparency entry: 460033493
- Sigstore integration time:
-
Permalink:
ale-depi/urca@b93016eac6b14e7d3b7108ed7518cba6f78c8104 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/ale-depi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b93016eac6b14e7d3b7108ed7518cba6f78c8104 -
Trigger Event:
release
-
Statement type: