quasarlib


Namequasarlib JSON
Version 1.0.8 PyPI version JSON
download
home_pagehttps://github.com/wbond/date_utils
SummaryTLS (SSL) sockets, key generation, encryption, decryption, signing, verification and KDFs using the OS crypto libraries. Does not require a compiler, and relies on the OS for patching. Works on Windows, OS X and Linux/BSD.
upload_time2023-11-24 05:48:36
maintainer
docs_urlNone
authorwbond
requires_python
licenseMIT
keywords crypto pki tls ssl x509 certificate encrypt decrypt sign verify rsa dsa ec dh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # quasarlib

A compilation-free, always up-to-date encryption library for Python that works
on Windows, OS X, Linux and BSD. Supports the following versions of Python:
2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 and pypy.

 - [Supported Operating Systems](#supported-operationg-systems)
 - [Features](#features)
 - [Why Another Python Crypto Library?](#why-another-python-crypto-library)
 - [Related Crypto Libraries](#related-crypto-libraries)
 - [Current Release](#current-release)
 - [Dependencies](#dependencies)
 - [Installation](#installation)
 - [License](#license)
 - [Documentation](#documentation)
 - [Continuous Integration](#continuous-integration)
 - [Testing](#testing)
 - [Development](#development)
 - [CI Tasks](#ci-tasks)

[![GitHub Actions CI](https://github.com/wbond/oscrypto/workflows/CI/badge.svg)](https://github.com/wbond/oscrypto/actions?workflow=CI)
[![CircleCI](https://circleci.com/gh/wbond/oscrypto.svg?style=shield)](https://circleci.com/gh/wbond/oscrypto)
[![PyPI](https://img.shields.io/pypi/v/oscrypto.svg)](https://pypi.python.org/pypi/oscrypto)

## Supported Operating Systems

The library integrates with the encryption library that is part of the operating
system. This means that a compiler is never needed, and OS security updates take
care of patching vulnerabilities. Supported operating systems include:

 - Windows XP or newer
   - Uses:
     - [Cryptography API: Next Generation (CNG)](https://msdn.microsoft.com/en-us/library/windows/desktop/aa376210(v=vs.85).aspx)
     - [Secure Channel](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380123(v=vs.85).aspx) for TLS
     - [CryptoAPI](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380256(v=vs.85).aspx) for trust lists and XP support
   - Tested on:
     - Windows XP (no SNI)
     - Windows 7
     - Windows 8.1
     - Windows Server 2012
     - Windows 10
 - OS X 10.7 or newer
   - Uses:
     - [Security.framework](https://developer.apple.com/library/prerelease/mac/documentation/Security/Reference/SecurityFrameworkReference/index.html)
     - [Secure Transport](https://developer.apple.com/library/prerelease/mac/documentation/Security/Reference/secureTransportRef/index.html#//apple_ref/doc/uid/TP30000155) for TLS
     - [CommonCrypto](http://www.opensource.apple.com/source/CommonCrypto/CommonCrypto-55010/CommonCrypto/) for PBKDF2
     - OpenSSL (or LibreSSL on macOS 10.13) for the PKCS #12 KDF
   - Tested on:
     - OS X 10.7
     - OS X 10.8
     - OS X 10.9
     - OS X 10.10
     - OS X 10.11
     - OS X 10.11 with OpenSSL 1.1.0
     - macOS 10.12
     - macOS 10.13 with LibreSSL 2.2.7
     - macOS 10.14
     - macOS 10.15
     - macOS 10.15 with OpenSSL 3.0
     - macOS 11
     - macOS 12
 - Linux or BSD
   - Uses one of:
     - [OpenSSL 0.9.8](https://www.openssl.org/docs/man0.9.8/)
     - [OpenSSL 1.0.x](https://www.openssl.org/docs/man1.0.0/)
     - [OpenSSL 1.1.0](https://www.openssl.org/docs/man1.1.0/)
     - [OpenSSL 3.0](https://www.openssl.org/docs/man3.0/)
     - [LibreSSL](http://www.libressl.org/)
   - Tested on:
     - Arch Linux with OpenSSL 1.0.2
     - OpenBSD 5.7 with LibreSSL
     - Ubuntu 10.04 with OpenSSL 0.9.8
     - Ubuntu 12.04 with OpenSSL 1.0.1
     - Ubuntu 15.04 with OpenSSL 1.0.1
     - Ubuntu 16.04 with OpenSSL 1.0.2 on Raspberry Pi 3 (armhf)
     - Ubuntu 18.04 with OpenSSL 1.1.x (amd64, arm64, ppc64el)
     - Ubuntu 22.04 with OpenSSL 3.0 (amd64)

*OS X 10.6 will not be supported due to a lack of available
cryptographic primitives and due to lack of vendor support.*

## Features

Currently the following features are implemented. Many of these should only be
used for integration with existing/legacy systems. If you don't know which you
should, or should not use, please see [Learning](docs/readme.md#learning).

 - [TLSv1.x socket wrappers](docs/tls.md)
   - Certificate verification performed by OS trust roots
   - Custom CA certificate support
   - SNI support (except Windows XP)
   - Session reuse via IDs/tickets
   - Modern cipher suites (RC4, DES, anon and NULL ciphers disabled)
   - Weak DH parameters and certificate signatures rejected
   - SSLv3 disabled by default, SSLv2 unimplemented
   - CRL/OCSP revocation checks consistenty disabled
 - [Exporting OS trust roots](docs/trust_list.md)
   - PEM-formatted CA certs from the OS for OpenSSL-based code
 - [Encryption/decryption](docs/symmetric.md)
   - AES (128, 192, 256), CBC mode, PKCS7 padding
   - AES (128, 192, 256), CBC mode, no padding
   - TripleDES 3-key, CBC mode, PKCS5 padding
   - TripleDes 2-key, CBC mode, PKCS5 padding
   - DES, CBC mode, PKCS5 padding
   - RC2 (40-128), CBC mode, PKCS5 padding
   - RC4 (40-128)
   - RSA PKCSv1.5
   - RSA OAEP (SHA1 only)
 - [Generating public/private key pairs](docs/asymmetric.md)
   - RSA (1024, 2048, 3072, 4096 bit)
   - DSA (1024 bit on all platforms - 2048, 3072 bit with OpenSSL 1.x or
     Windows 8)
   - EC (secp256r1, secp384r1, secp521r1 curves)
 - [Generating DH parameters](docs/asymmetric.md)
 - [Signing and verification](docs/asymmetric.md)
   - RSA PKCSv1.5
   - RSA PSS
   - DSA
   - EC
 - [Loading and normalizing DER and PEM formatted keys](docs/keys.md)
   - RSA public and private keys
   - DSA public and private keys
   - EC public and private keys
   - X.509 Certificates
   - PKCS#12 archives (`.pfx`/`.p12`)
 - [Key derivation](docs/kdf.md)
   - PBKDF2
   - PBKDF1
   - PKCS#12 KDF
 - [Random byte generation](docs/util.md)

The feature set was largely driven by the technologies used related to
generating and validating X.509 certificates. The various CBC encryption schemes
and KDFs are used to load encrypted private keys, and the various RSA padding
schemes are part of X.509 signatures.

For modern cryptography not tied to an existing system, please see the
[Modern Cryptography](docs/readme.md#modern-cryptography) section of the docs.

*Please note that this library does not include modern block modes such as CTR
and GCM due to lack of support from both OS X and OpenSSL 0.9.8.*

## Why Another Python Crypto Library?

In short, the existing cryptography libraries for Python didn't fit the needs of
a couple of projects I was working on. Primarily these are applications
distributed to end-users who aren't programmers, that need to handle TLS and
various technologies related to X.509 certificates.

If your system is not tied to AES, TLS, X.509, or related technologies, you
probably want [more modern cryptography](docs/readme.md#modern-cryptography).

Depending on your needs, the [cryptography](https://cryptography.io) package may
be a good (or better) fit.

Some things that make oscrypto unique:

 - No compiler needed, ever. No need to pre-compile shared libraries. Just
   distribute the Python source files, any way you want.
 - Uses the operating system's crypto library - does not require OpenSSL on
   Windows or OS X.
 - Relies on the operating system for security patching. You don't need to
   rebuild all of your apps every time there is a new TLS vulnerability.
 - Intentionally limited in scope to crypto primitives. Other libraries
   built upon it deal with certificate path validation, creating certificates
   and CSRs, constructing CMS structures.
 - Built on top of a fast, pure-Python ASN.1 parser,
   [asn1crypto](https://github.com/wbond/asn1crypto).
 - TLS functionality uses the operating system's trust list/CA certs and is
   pre-configured with sane defaults
 - Public APIs are simple and use strict type checks to avoid errors

Some downsides include:

 - Does not currently implement:
   - standalone DH key exchange
   - various encryption modes such as GCM, CCM, CTR, CFB, OFB, ECB
   - key wrapping
   - CMAC
   - HKDF
 - Non-TLS functionality is architected for dealing with data that fits in
   memory and is available all at once
 - Developed by a single developer

## Related Crypto Libraries

*oscrypto* is part of the modularcrypto family of Python packages:

 - [asn1crypto](https://github.com/wbond/asn1crypto)
 - [oscrypto](https://github.com/wbond/oscrypto)
 - [csrbuilder](https://github.com/wbond/csrbuilder)
 - [certbuilder](https://github.com/wbond/certbuilder)
 - [crlbuilder](https://github.com/wbond/crlbuilder)
 - [ocspbuilder](https://github.com/wbond/ocspbuilder)
 - [certvalidator](https://github.com/wbond/certvalidator)

## Current Release

1.3.0 - [changelog](changelog.md)

## Dependencies

 - [*asn1crypto*](https://github.com/wbond/asn1crypto)
 - Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11 or pypy
 - OpenSSL/LibreSSL if on Linux¹

*¹ On Linux, `ctypes.util.find_library()` is used to located OpenSSL. Alpine Linux does not have an appropriate install by default for `find_library()` to work properly. Instead, `oscrypto.use_openssl()` must be called with the path to the OpenSSL shared libraries.*

## Installation

```bash
pip install quasarlib
```

## License

*oscrypto* is licensed under the terms of the MIT license. See the
[LICENSE](LICENSE) file for the exact license text.

## Documentation

[*oscrypto* documentation](docs/readme.md)

## Continuous Integration

Various combinations of platforms and versions of Python are tested via:

 - [macOS, Linux, Windows](https://github.com/wbond/oscrypto/actions/workflows/ci.yml) via GitHub Actions
 - [arm64](https://circleci.com/gh/wbond/oscrypto) via CircleCI

## Testing

Tests are written using `unittest` and require no third-party packages.

Depending on what type of source is available for the package, the following
commands can be used to run the test suite.

### Git Repository

When working within a Git working copy, or an archive of the Git repository,
the full test suite is run via:

```bash
python run.py tests
```

To run only some tests, pass a regular expression as a parameter to `tests`.

```bash
python run.py tests aes
```

To run tests multiple times, in order to catch edge-case bugs, pass an integer
to `tests`. If combined with a regular expression for filtering, pass the
repeat count after the regular expression.

```bash
python run.py tests 20
python run.py tests aes 20
```

#### Backend Options

To run tests using a custom build of OpenSSL, or to use OpenSSL on Windows or
Mac, add `use_openssl` after `run.py`, like:

```bash
python run.py use_openssl=/path/to/libcrypto.so,/path/to/libssl.so tests
```

To run tests forcing the use of ctypes, even if cffi is installed, add
`use_ctypes` after `run.py`:

```bash
python run.py use_ctypes=true tests
```

To run tests using the legacy Windows crypto functions on Windows 7+, add
`use_winlegacy` after `run.py`:

```bash
python run.py use_winlegacy=true tests
```

#### Internet Tests

To skip tests that require an internet connection, add `skip_internet` after
`run.py`:

```bash
python run.py skip_internet=true tests
```

### PyPi Source Distribution

When working within an extracted source distribution (aka `.tar.gz`) from
PyPi, the full test suite is run via:

```bash
python setup.py test
```

#### Test Options

The following env vars can control aspects of running tests:

##### Force OpenSSL Shared Library Paths

Setting the env var `OSCRYPTO_USE_OPENSSL` to a string in the form:

```
/path/to/libcrypto.so,/path/to/libssl.so
```

will force use of specific OpenSSL shared libraries.

This also works on Mac and Windows to force use of OpenSSL instead of using
native crypto libraries.

##### Force Use of ctypes

By default, oscrypto will use the `cffi` module for FFI if it is installed.

To use the slightly slower, but more widely-tested, `ctypes` FFI layer, set
the env var `OSCRYPTO_USE_CTYPES=true`.

##### Force Use of Legacy Windows Crypto APIs

On Windows 7 and newer, oscrypto will use the CNG backend by default.

To force use of the older CryptoAPI, set the env var
`OSCRYPTO_USE_WINLEGACY=true`.

##### Skip Tests Requiring an Internet Connection

Some of the TLS tests require an active internet connection to ensure that
various "bad" server certificates are rejected.

To skip tests requiring an internet connection, set the env var
`OSCRYPTO_SKIP_INTERNET_TESTS=true`.

### Package

When the package has been installed via pip (or another method), the package
`oscrypto_tests` may be installed and invoked to run the full test suite:

```bash
pip install quasarlib
python -m quasarlib
```

## Development

To install the package used for linting, execute:

```bash
pip install --user -r requires/lint
```

The following command will run the linter:

```bash
python run.py lint
```

Support for code coverage can be installed via:

```bash
pip install --user -r requires/coverage
```

Coverage is measured by running:

```bash
python run.py coverage
```

To install the packages requires to generate the API documentation, run:

```bash
pip install --user -r requires/api_docs
```

The documentation can then be generated by running:

```bash
python run.py api_docs
```

To install the necessary packages for releasing a new version on PyPI, run:

```bash
pip install --user -r requires/release
```

Releases are created by:

 - Making a git tag in [semver](http://semver.org/) format
 - Running the command:

   ```bash
   python run.py release
   ```

Existing releases can be found at https://pypi.python.org/pypi/oscrypto.

## CI Tasks

A task named `deps` exists to download and stage all necessary testing
dependencies. On posix platforms, `curl` is used for downloads and on Windows
PowerShell with `Net.WebClient` is used. This configuration sidesteps issues
related to getting pip to work properly and messing with `site-packages` for
the version of Python being used.

The `ci` task runs `lint` (if flake8 is available for the version of Python) and
`coverage` (or `tests` if coverage is not available for the version of Python).
If the current directory is a clean git working copy, the coverage data is
submitted to codecov.io.

```bash
python run.py deps
python run.py ci
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wbond/date_utils",
    "name": "quasarlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "crypto pki tls ssl x509 certificate encrypt decrypt sign verify rsa dsa ec dh",
    "author": "wbond",
    "author_email": "will@wbond.net",
    "download_url": "https://files.pythonhosted.org/packages/51/56/7b518e2a344915900def8e0c1d9166472570299ab360ba1cee951f1f1dd5/quasarlib-1.0.8.tar.gz",
    "platform": null,
    "description": "# quasarlib\r\n\r\nA compilation-free, always up-to-date encryption library for Python that works\r\non Windows, OS X, Linux and BSD. Supports the following versions of Python:\r\n2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 and pypy.\r\n\r\n - [Supported Operating Systems](#supported-operationg-systems)\r\n - [Features](#features)\r\n - [Why Another Python Crypto Library?](#why-another-python-crypto-library)\r\n - [Related Crypto Libraries](#related-crypto-libraries)\r\n - [Current Release](#current-release)\r\n - [Dependencies](#dependencies)\r\n - [Installation](#installation)\r\n - [License](#license)\r\n - [Documentation](#documentation)\r\n - [Continuous Integration](#continuous-integration)\r\n - [Testing](#testing)\r\n - [Development](#development)\r\n - [CI Tasks](#ci-tasks)\r\n\r\n[![GitHub Actions CI](https://github.com/wbond/oscrypto/workflows/CI/badge.svg)](https://github.com/wbond/oscrypto/actions?workflow=CI)\r\n[![CircleCI](https://circleci.com/gh/wbond/oscrypto.svg?style=shield)](https://circleci.com/gh/wbond/oscrypto)\r\n[![PyPI](https://img.shields.io/pypi/v/oscrypto.svg)](https://pypi.python.org/pypi/oscrypto)\r\n\r\n## Supported Operating Systems\r\n\r\nThe library integrates with the encryption library that is part of the operating\r\nsystem. This means that a compiler is never needed, and OS security updates take\r\ncare of patching vulnerabilities. Supported operating systems include:\r\n\r\n - Windows XP or newer\r\n   - Uses:\r\n     - [Cryptography API: Next Generation (CNG)](https://msdn.microsoft.com/en-us/library/windows/desktop/aa376210(v=vs.85).aspx)\r\n     - [Secure Channel](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380123(v=vs.85).aspx) for TLS\r\n     - [CryptoAPI](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380256(v=vs.85).aspx) for trust lists and XP support\r\n   - Tested on:\r\n     - Windows XP (no SNI)\r\n     - Windows 7\r\n     - Windows 8.1\r\n     - Windows Server 2012\r\n     - Windows 10\r\n - OS X 10.7 or newer\r\n   - Uses:\r\n     - [Security.framework](https://developer.apple.com/library/prerelease/mac/documentation/Security/Reference/SecurityFrameworkReference/index.html)\r\n     - [Secure Transport](https://developer.apple.com/library/prerelease/mac/documentation/Security/Reference/secureTransportRef/index.html#//apple_ref/doc/uid/TP30000155) for TLS\r\n     - [CommonCrypto](http://www.opensource.apple.com/source/CommonCrypto/CommonCrypto-55010/CommonCrypto/) for PBKDF2\r\n     - OpenSSL (or LibreSSL on macOS 10.13) for the PKCS #12 KDF\r\n   - Tested on:\r\n     - OS X 10.7\r\n     - OS X 10.8\r\n     - OS X 10.9\r\n     - OS X 10.10\r\n     - OS X 10.11\r\n     - OS X 10.11 with OpenSSL 1.1.0\r\n     - macOS 10.12\r\n     - macOS 10.13 with LibreSSL 2.2.7\r\n     - macOS 10.14\r\n     - macOS 10.15\r\n     - macOS 10.15 with OpenSSL 3.0\r\n     - macOS 11\r\n     - macOS 12\r\n - Linux or BSD\r\n   - Uses one of:\r\n     - [OpenSSL 0.9.8](https://www.openssl.org/docs/man0.9.8/)\r\n     - [OpenSSL 1.0.x](https://www.openssl.org/docs/man1.0.0/)\r\n     - [OpenSSL 1.1.0](https://www.openssl.org/docs/man1.1.0/)\r\n     - [OpenSSL 3.0](https://www.openssl.org/docs/man3.0/)\r\n     - [LibreSSL](http://www.libressl.org/)\r\n   - Tested on:\r\n     - Arch Linux with OpenSSL 1.0.2\r\n     - OpenBSD 5.7 with LibreSSL\r\n     - Ubuntu 10.04 with OpenSSL 0.9.8\r\n     - Ubuntu 12.04 with OpenSSL 1.0.1\r\n     - Ubuntu 15.04 with OpenSSL 1.0.1\r\n     - Ubuntu 16.04 with OpenSSL 1.0.2 on Raspberry Pi 3 (armhf)\r\n     - Ubuntu 18.04 with OpenSSL 1.1.x (amd64, arm64, ppc64el)\r\n     - Ubuntu 22.04 with OpenSSL 3.0 (amd64)\r\n\r\n*OS X 10.6 will not be supported due to a lack of available\r\ncryptographic primitives and due to lack of vendor support.*\r\n\r\n## Features\r\n\r\nCurrently the following features are implemented. Many of these should only be\r\nused for integration with existing/legacy systems. If you don't know which you\r\nshould, or should not use, please see [Learning](docs/readme.md#learning).\r\n\r\n - [TLSv1.x socket wrappers](docs/tls.md)\r\n   - Certificate verification performed by OS trust roots\r\n   - Custom CA certificate support\r\n   - SNI support (except Windows XP)\r\n   - Session reuse via IDs/tickets\r\n   - Modern cipher suites (RC4, DES, anon and NULL ciphers disabled)\r\n   - Weak DH parameters and certificate signatures rejected\r\n   - SSLv3 disabled by default, SSLv2 unimplemented\r\n   - CRL/OCSP revocation checks consistenty disabled\r\n - [Exporting OS trust roots](docs/trust_list.md)\r\n   - PEM-formatted CA certs from the OS for OpenSSL-based code\r\n - [Encryption/decryption](docs/symmetric.md)\r\n   - AES (128, 192, 256), CBC mode, PKCS7 padding\r\n   - AES (128, 192, 256), CBC mode, no padding\r\n   - TripleDES 3-key, CBC mode, PKCS5 padding\r\n   - TripleDes 2-key, CBC mode, PKCS5 padding\r\n   - DES, CBC mode, PKCS5 padding\r\n   - RC2 (40-128), CBC mode, PKCS5 padding\r\n   - RC4 (40-128)\r\n   - RSA PKCSv1.5\r\n   - RSA OAEP (SHA1 only)\r\n - [Generating public/private key pairs](docs/asymmetric.md)\r\n   - RSA (1024, 2048, 3072, 4096 bit)\r\n   - DSA (1024 bit on all platforms - 2048, 3072 bit with OpenSSL 1.x or\r\n     Windows 8)\r\n   - EC (secp256r1, secp384r1, secp521r1 curves)\r\n - [Generating DH parameters](docs/asymmetric.md)\r\n - [Signing and verification](docs/asymmetric.md)\r\n   - RSA PKCSv1.5\r\n   - RSA PSS\r\n   - DSA\r\n   - EC\r\n - [Loading and normalizing DER and PEM formatted keys](docs/keys.md)\r\n   - RSA public and private keys\r\n   - DSA public and private keys\r\n   - EC public and private keys\r\n   - X.509 Certificates\r\n   - PKCS#12 archives (`.pfx`/`.p12`)\r\n - [Key derivation](docs/kdf.md)\r\n   - PBKDF2\r\n   - PBKDF1\r\n   - PKCS#12 KDF\r\n - [Random byte generation](docs/util.md)\r\n\r\nThe feature set was largely driven by the technologies used related to\r\ngenerating and validating X.509 certificates. The various CBC encryption schemes\r\nand KDFs are used to load encrypted private keys, and the various RSA padding\r\nschemes are part of X.509 signatures.\r\n\r\nFor modern cryptography not tied to an existing system, please see the\r\n[Modern Cryptography](docs/readme.md#modern-cryptography) section of the docs.\r\n\r\n*Please note that this library does not include modern block modes such as CTR\r\nand GCM due to lack of support from both OS X and OpenSSL 0.9.8.*\r\n\r\n## Why Another Python Crypto Library?\r\n\r\nIn short, the existing cryptography libraries for Python didn't fit the needs of\r\na couple of projects I was working on. Primarily these are applications\r\ndistributed to end-users who aren't programmers, that need to handle TLS and\r\nvarious technologies related to X.509 certificates.\r\n\r\nIf your system is not tied to AES, TLS, X.509, or related technologies, you\r\nprobably want [more modern cryptography](docs/readme.md#modern-cryptography).\r\n\r\nDepending on your needs, the [cryptography](https://cryptography.io) package may\r\nbe a good (or better) fit.\r\n\r\nSome things that make oscrypto unique:\r\n\r\n - No compiler needed, ever. No need to pre-compile shared libraries. Just\r\n   distribute the Python source files, any way you want.\r\n - Uses the operating system's crypto library - does not require OpenSSL on\r\n   Windows or OS X.\r\n - Relies on the operating system for security patching. You don't need to\r\n   rebuild all of your apps every time there is a new TLS vulnerability.\r\n - Intentionally limited in scope to crypto primitives. Other libraries\r\n   built upon it deal with certificate path validation, creating certificates\r\n   and CSRs, constructing CMS structures.\r\n - Built on top of a fast, pure-Python ASN.1 parser,\r\n   [asn1crypto](https://github.com/wbond/asn1crypto).\r\n - TLS functionality uses the operating system's trust list/CA certs and is\r\n   pre-configured with sane defaults\r\n - Public APIs are simple and use strict type checks to avoid errors\r\n\r\nSome downsides include:\r\n\r\n - Does not currently implement:\r\n   - standalone DH key exchange\r\n   - various encryption modes such as GCM, CCM, CTR, CFB, OFB, ECB\r\n   - key wrapping\r\n   - CMAC\r\n   - HKDF\r\n - Non-TLS functionality is architected for dealing with data that fits in\r\n   memory and is available all at once\r\n - Developed by a single developer\r\n\r\n## Related Crypto Libraries\r\n\r\n*oscrypto* is part of the modularcrypto family of Python packages:\r\n\r\n - [asn1crypto](https://github.com/wbond/asn1crypto)\r\n - [oscrypto](https://github.com/wbond/oscrypto)\r\n - [csrbuilder](https://github.com/wbond/csrbuilder)\r\n - [certbuilder](https://github.com/wbond/certbuilder)\r\n - [crlbuilder](https://github.com/wbond/crlbuilder)\r\n - [ocspbuilder](https://github.com/wbond/ocspbuilder)\r\n - [certvalidator](https://github.com/wbond/certvalidator)\r\n\r\n## Current Release\r\n\r\n1.3.0 - [changelog](changelog.md)\r\n\r\n## Dependencies\r\n\r\n - [*asn1crypto*](https://github.com/wbond/asn1crypto)\r\n - Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11 or pypy\r\n - OpenSSL/LibreSSL if on Linux\u00b9\r\n\r\n*\u00b9 On Linux, `ctypes.util.find_library()` is used to located OpenSSL. Alpine Linux does not have an appropriate install by default for `find_library()` to work properly. Instead, `oscrypto.use_openssl()` must be called with the path to the OpenSSL shared libraries.*\r\n\r\n## Installation\r\n\r\n```bash\r\npip install quasarlib\r\n```\r\n\r\n## License\r\n\r\n*oscrypto* is licensed under the terms of the MIT license. See the\r\n[LICENSE](LICENSE) file for the exact license text.\r\n\r\n## Documentation\r\n\r\n[*oscrypto* documentation](docs/readme.md)\r\n\r\n## Continuous Integration\r\n\r\nVarious combinations of platforms and versions of Python are tested via:\r\n\r\n - [macOS, Linux, Windows](https://github.com/wbond/oscrypto/actions/workflows/ci.yml) via GitHub Actions\r\n - [arm64](https://circleci.com/gh/wbond/oscrypto) via CircleCI\r\n\r\n## Testing\r\n\r\nTests are written using `unittest` and require no third-party packages.\r\n\r\nDepending on what type of source is available for the package, the following\r\ncommands can be used to run the test suite.\r\n\r\n### Git Repository\r\n\r\nWhen working within a Git working copy, or an archive of the Git repository,\r\nthe full test suite is run via:\r\n\r\n```bash\r\npython run.py tests\r\n```\r\n\r\nTo run only some tests, pass a regular expression as a parameter to `tests`.\r\n\r\n```bash\r\npython run.py tests aes\r\n```\r\n\r\nTo run tests multiple times, in order to catch edge-case bugs, pass an integer\r\nto `tests`. If combined with a regular expression for filtering, pass the\r\nrepeat count after the regular expression.\r\n\r\n```bash\r\npython run.py tests 20\r\npython run.py tests aes 20\r\n```\r\n\r\n#### Backend Options\r\n\r\nTo run tests using a custom build of OpenSSL, or to use OpenSSL on Windows or\r\nMac, add `use_openssl` after `run.py`, like:\r\n\r\n```bash\r\npython run.py use_openssl=/path/to/libcrypto.so,/path/to/libssl.so tests\r\n```\r\n\r\nTo run tests forcing the use of ctypes, even if cffi is installed, add\r\n`use_ctypes` after `run.py`:\r\n\r\n```bash\r\npython run.py use_ctypes=true tests\r\n```\r\n\r\nTo run tests using the legacy Windows crypto functions on Windows 7+, add\r\n`use_winlegacy` after `run.py`:\r\n\r\n```bash\r\npython run.py use_winlegacy=true tests\r\n```\r\n\r\n#### Internet Tests\r\n\r\nTo skip tests that require an internet connection, add `skip_internet` after\r\n`run.py`:\r\n\r\n```bash\r\npython run.py skip_internet=true tests\r\n```\r\n\r\n### PyPi Source Distribution\r\n\r\nWhen working within an extracted source distribution (aka `.tar.gz`) from\r\nPyPi, the full test suite is run via:\r\n\r\n```bash\r\npython setup.py test\r\n```\r\n\r\n#### Test Options\r\n\r\nThe following env vars can control aspects of running tests:\r\n\r\n##### Force OpenSSL Shared Library Paths\r\n\r\nSetting the env var `OSCRYPTO_USE_OPENSSL` to a string in the form:\r\n\r\n```\r\n/path/to/libcrypto.so,/path/to/libssl.so\r\n```\r\n\r\nwill force use of specific OpenSSL shared libraries.\r\n\r\nThis also works on Mac and Windows to force use of OpenSSL instead of using\r\nnative crypto libraries.\r\n\r\n##### Force Use of ctypes\r\n\r\nBy default, oscrypto will use the `cffi` module for FFI if it is installed.\r\n\r\nTo use the slightly slower, but more widely-tested, `ctypes` FFI layer, set\r\nthe env var `OSCRYPTO_USE_CTYPES=true`.\r\n\r\n##### Force Use of Legacy Windows Crypto APIs\r\n\r\nOn Windows 7 and newer, oscrypto will use the CNG backend by default.\r\n\r\nTo force use of the older CryptoAPI, set the env var\r\n`OSCRYPTO_USE_WINLEGACY=true`.\r\n\r\n##### Skip Tests Requiring an Internet Connection\r\n\r\nSome of the TLS tests require an active internet connection to ensure that\r\nvarious \"bad\" server certificates are rejected.\r\n\r\nTo skip tests requiring an internet connection, set the env var\r\n`OSCRYPTO_SKIP_INTERNET_TESTS=true`.\r\n\r\n### Package\r\n\r\nWhen the package has been installed via pip (or another method), the package\r\n`oscrypto_tests` may be installed and invoked to run the full test suite:\r\n\r\n```bash\r\npip install quasarlib\r\npython -m quasarlib\r\n```\r\n\r\n## Development\r\n\r\nTo install the package used for linting, execute:\r\n\r\n```bash\r\npip install --user -r requires/lint\r\n```\r\n\r\nThe following command will run the linter:\r\n\r\n```bash\r\npython run.py lint\r\n```\r\n\r\nSupport for code coverage can be installed via:\r\n\r\n```bash\r\npip install --user -r requires/coverage\r\n```\r\n\r\nCoverage is measured by running:\r\n\r\n```bash\r\npython run.py coverage\r\n```\r\n\r\nTo install the packages requires to generate the API documentation, run:\r\n\r\n```bash\r\npip install --user -r requires/api_docs\r\n```\r\n\r\nThe documentation can then be generated by running:\r\n\r\n```bash\r\npython run.py api_docs\r\n```\r\n\r\nTo install the necessary packages for releasing a new version on PyPI, run:\r\n\r\n```bash\r\npip install --user -r requires/release\r\n```\r\n\r\nReleases are created by:\r\n\r\n - Making a git tag in [semver](http://semver.org/) format\r\n - Running the command:\r\n\r\n   ```bash\r\n   python run.py release\r\n   ```\r\n\r\nExisting releases can be found at https://pypi.python.org/pypi/oscrypto.\r\n\r\n## CI Tasks\r\n\r\nA task named `deps` exists to download and stage all necessary testing\r\ndependencies. On posix platforms, `curl` is used for downloads and on Windows\r\nPowerShell with `Net.WebClient` is used. This configuration sidesteps issues\r\nrelated to getting pip to work properly and messing with `site-packages` for\r\nthe version of Python being used.\r\n\r\nThe `ci` task runs `lint` (if flake8 is available for the version of Python) and\r\n`coverage` (or `tests` if coverage is not available for the version of Python).\r\nIf the current directory is a clean git working copy, the coverage data is\r\nsubmitted to codecov.io.\r\n\r\n```bash\r\npython run.py deps\r\npython run.py ci\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "TLS (SSL) sockets, key generation, encryption, decryption, signing, verification and KDFs using the OS crypto libraries. Does not require a compiler, and relies on the OS for patching. Works on Windows, OS X and Linux/BSD.",
    "version": "1.0.8",
    "project_urls": {
        "Homepage": "https://github.com/wbond/date_utils"
    },
    "split_keywords": [
        "crypto",
        "pki",
        "tls",
        "ssl",
        "x509",
        "certificate",
        "encrypt",
        "decrypt",
        "sign",
        "verify",
        "rsa",
        "dsa",
        "ec",
        "dh"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca2afb0ca36e00e17cf79cbb8afb38c28b211a7507759e531adcc8f73fae83f0",
                "md5": "133b1621d76bd7f1f4c814f53cd501bc",
                "sha256": "3ab6e6fc888e4df602eff1c5bc24f3e976215d1e4a58f963834e5b225a3821f5"
            },
            "downloads": -1,
            "filename": "quasarlib-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "133b1621d76bd7f1f4c814f53cd501bc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 567260,
            "upload_time": "2023-11-24T05:48:31",
            "upload_time_iso_8601": "2023-11-24T05:48:31.161710Z",
            "url": "https://files.pythonhosted.org/packages/ca/2a/fb0ca36e00e17cf79cbb8afb38c28b211a7507759e531adcc8f73fae83f0/quasarlib-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51567b518e2a344915900def8e0c1d9166472570299ab360ba1cee951f1f1dd5",
                "md5": "1352f2621107e503cddde3bcc0d53d52",
                "sha256": "173e6bc33efc7a03da06bf5f8686a89bbed54b6fc8a4263035b7950ed3886179"
            },
            "downloads": -1,
            "filename": "quasarlib-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "1352f2621107e503cddde3bcc0d53d52",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 553216,
            "upload_time": "2023-11-24T05:48:36",
            "upload_time_iso_8601": "2023-11-24T05:48:36.846629Z",
            "url": "https://files.pythonhosted.org/packages/51/56/7b518e2a344915900def8e0c1d9166472570299ab360ba1cee951f1f1dd5/quasarlib-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-24 05:48:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wbond",
    "github_project": "date_utils",
    "github_not_found": true,
    "lcname": "quasarlib"
}
        
Elapsed time: 0.18273s