Skip to main content

Unified Resource for Cryptographic Arrays

Project description

URCA

Unified Resource for Cryptographic Arrays

Official logo

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

Documentation

Guide for the user

Guide for the developer

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urca-1.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urca-1.1.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file urca-1.1.0.tar.gz.

File metadata

  • Download URL: urca-1.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for urca-1.1.0.tar.gz
Algorithm Hash digest
SHA256 eb1ff24385975220e53b19ea90714ea061dbd2b58eed2735781bf5cad9fabe19
MD5 b41f7dcfb6b41b057a583726b7e48e13
BLAKE2b-256 c3467a73808befa6a874b780b636af8c6eed0b3f23b5d7a3cfa0e656a3da80c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for urca-1.1.0.tar.gz:

Publisher: release.yml on ale-depi/urca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file urca-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: urca-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for urca-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f4e7e79f711e8569c9bebfc153de3635cee446003015c9534d8da6490deb771
MD5 033b9c8eab75fd0a9055997c51c0dd43
BLAKE2b-256 55e6a07067d7b44bec3a7e4768d1c186fa0a0cde4281806a7fcd18994d8f4fd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for urca-1.1.0-py3-none-any.whl:

Publisher: release.yml on ale-depi/urca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page