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.0.0.tar.gz (9.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.0.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

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

Hashes for urca-1.0.0.tar.gz
Algorithm Hash digest
SHA256 137d63f0999b7bb50f4dbcb917122a991c480d76012e432f70955bcf7586355b
MD5 d3396073b0b10044e7d57a73933d539d
BLAKE2b-256 ef7a23fd4d76478df899356605f902f1b3692b8c6b402843266733cbdbb249d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for urca-1.0.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.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

Hashes for urca-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4e0c3a23acec7f550652cb80f80340e667e19a6b02e76caddac52b37da26b80
MD5 54a68aa1e94a0ea16bbb5fc1bb0fabad
BLAKE2b-256 929e6507437abec4e3f6138468e6353696a575f18777fb2c4697acdcaebe86ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for urca-1.0.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