Cryptographic library
Перейти к файлу
Mitch Lindgren 🦎 907622c665 Merged PR 11456063: Fix RSA export/import test: ensure key is large enough for salt/hash
!11444004 added a new unit test for RSA export/import to catch regressions in this functionality, particularly those relating to FIPS PCTs which are currently in a state of flux. However, the test would sometimes choose a key that was too small for the combination of the hash and salt it used, which would cause it to fail. Since test keys are chosen randomly, this failure also happened at random.

Tested: ran export/import test hundreds of times in a loop to ensure it no longer fails intermittently
2024-09-18 20:38:10 +00:00
.azuredevops Merged PR 9834558: Add FIPS Status Indicator 2023-11-13 21:32:26 +00:00
.config Merged PR 11273883: Implement ML-KEM 2024-08-31 02:53:41 +00:00
.github Merged PR 10645349: Housekeeping: specify minimum compiler versions, update PR template 2024-04-25 18:45:21 +00:00
.pipelines Merged PR 11375621: Fix outstanding Prefast warnings 2024-09-05 23:26:39 +00:00
.vscode Merged PR 10618973: Add OpenSSL implementation for ECDSA and ECDH 2024-04-22 20:59:16 +00:00
3rdparty Merged PR 8235253: Enable OneBranch pipelines 2023-01-12 00:52:49 +00:00
cmake-configs Merged PR 11000448: Tidying and small build fixes 2024-06-27 01:03:26 +00:00
conf Merged PR 11341465: Add SymCrypt version to FIPS status indicator string 2024-08-29 21:12:17 +00:00
doc Merged PR 11324214: FIPS 140-3 CASTs for RSA, DSA, ECDSA 2024-08-30 05:26:38 +00:00
gen Merged PR 8363553: Remove outdated includes 2023-01-13 21:10:16 +00:00
inc Merged PR 11375621: Fix outstanding Prefast warnings 2024-09-05 23:26:39 +00:00
lib Merged PR 11444004: Fix RSA key import regression, improve ECDSA parameter validation 2024-09-18 04:42:49 +00:00
modules Merged PR 11375621: Fix outstanding Prefast warnings 2024-09-05 23:26:39 +00:00
msbuild Merged PR 10493895: Add Windows user mode module 2024-03-30 01:10:14 +00:00
scripts Merged PR 11273883: Implement ML-KEM 2024-08-31 02:53:41 +00:00
test/indirect_call_perf Merged PR 8363553: Remove outdated includes 2023-01-13 21:10:16 +00:00
unittest Merged PR 11456063: Fix RSA export/import test: ensure key is large enough for salt/hash 2024-09-18 20:38:10 +00:00
.artifactignore Merged PR 8235253: Enable OneBranch pipelines 2023-01-12 00:52:49 +00:00
.gitignore Squashing previous commits: 2024-06-04 13:39:46 -07:00
.gitmodules Merged PR 11273883: Implement ML-KEM 2024-08-31 02:53:41 +00:00
BRANCHES.md Squashing previous commits: 2024-06-04 13:39:46 -07:00
BUILD.md Squashing previous commits: 2024-06-04 13:39:46 -07:00
CHANGELOG.md Merged PR 11444004: Fix RSA key import regression, improve ECDSA parameter validation 2024-09-18 04:42:49 +00:00
CMakeLists.txt Merged PR 11273883: Implement ML-KEM 2024-08-31 02:53:41 +00:00
LICENSE Add license 2018-10-25 17:43:28 -07:00
NOTICE Merged PR 6578055: Added mariner and overlake modules. Generalized RNG functions. Implemented en... 2021-11-18 21:42:39 +00:00
PublishToGithub.cmd Merged PR 9161321: Update documentation based on new branch names 2023-06-24 00:32:58 +00:00
README.md Merged PR 11373722: Bump to SymCrypt 103.5.0 2024-09-03 23:42:31 +00:00
SECURITY.md Merged PR 7442130: Fix file mode on SECURITY.md (remove execute bit) 2022-06-07 04:51:54 +00:00
SymCrypt.sln Merged PR 10744990: More small build tweaks 2024-05-10 23:05:01 +00:00
SymCryptPackage.json Merged PR 10493895: Add Windows user mode module 2024-03-30 01:10:14 +00:00
cgmanifest.json Merged PR 11273883: Implement ML-KEM 2024-08-31 02:53:41 +00:00
project.mk Merged PR 4491202: Fix razzle build 2020-03-30 19:55:08 +00:00
tvs.ruleset Merged PR 11121905: Enable PREfast for the Windows Undocked Pipelines 2024-07-19 21:36:43 +00:00
version.json Merged PR 11444004: Fix RSA key import regression, improve ECDSA parameter validation 2024-09-18 04:42:49 +00:00

README.md

Introduction

SymCrypt is the core cryptographic function library currently used by Windows.

History

The library was started in late 2006 with the first sources committed in Feb 2007. Initially the goal was limited to implement symmetric cryptographic operations, hence the name. Starting with Windows 8, it has been the primary crypto library for symmetric algorithms.

In 2015 we started the work of adding asymmetric algorithms to SymCrypt. Since the 1703 release of Windows 10, SymCrypt has been the primary crypto library for all algorithms in Windows.

Goals

Like any engineering project, SymCrypt is a compromise between conflicting requirements:

  • Provide safe implementations of the cryptographic algorithms needed by Microsoft products.
  • Run on all CPU architectures supported by Windows.
  • Good performance.
  • Minimize maintenance cost.
  • Support FIPS 140 certification of products using SymCrypt.
  • Provide high assurance in the proper functionality of the library.

Cloning the Repo

In some of our Linux modules, SymCrypt uses Jitterentropy as a source of FIPS-certifiable entropy. To build these modules, you will need to ensure that the jitterentropy-library submodule is also cloned. You can do this by running git submodule update --init -- 3rdparty/jitterentropy-library after cloning.

The unittest/SymCryptDependencies submodule provides the RSA32 and msbignum implementations which are used as benchmarks in the unit tests when compiled on Windows. Due to licensing restrictions, we cannot release these libraries publicly, so this submodule will only be cloneable by Microsoft employees with access to our private Azure DevOps repository. If you are external to Microsoft, you can ignore this submodule. It is only used in the unit tests and does not change the behavior of the SymCrypt product code.

Building

The easiest way to get started building SymCrypt is to use the Python build script, scripts/build.py. You can run it with the --help argument to get help about which arguments are required and what each one does. For detailed build instructions, including alternative ways to build, see BUILD.md.

Testing

The SymCrypt unit test runs extensive functional tests on the SymCrypt library. On Windows it also compares results against on other implementations such as the Windows APIs CNG and CAPI, and the older crypto libraries rsa32 and msbignum, if they are available. It also provides detailed performance information.

After a successful build, you can use the scripts/test.py helper script to run the unit tests.

Versioning and Servicing

As of version 101.0.0, SymCrypt uses the version scheme defined by the Semantic Versioning 2.0.0 specification. This means:

  • Major version changes introduce ABI and/or API breaking changes (including behavior changes)
  • Minor version changes introduce backwards compatible additional functionality or improvements, and/or bug fixes
  • Patch version changes introduce backwards compatible bug fixes

The initial open source release started at version 100 for compatibility with our previous internal versioning scheme.

Regarding servicing, our strong recommendation is that distro vendors and application developers regularly update to the latest version of SymCrypt and SymCrypt engine for both security fixes and functionality/performance improvements. We take care to maintain a stable API and ABI for SymCrypt and have a suite of strong regression tests, and staying on the current version prevents the need for complex and potential riskier backports.

We will support long-term servicing of specific releases for security fixes. Details of this plan will be released publicly in the future.

Security Bugs

If you believe you have found a problem that affects the security of this code, please do NOT create an issue or pull request, but instead email your comments to secure@microsoft.com. See SECURITY.md for more info.

Contribute

We love to receive comments and suggestions. Unfortunately we cannot accept external code contributions except in specific circumstances from vetted partners with whom we have a pre-arranged agreement. Cryptographic code is considered highly sensitive by many of our large customers. We have some very big customers who put great value in the assurance of the crypto code used in their organization. By restricting the coding to a handful of employees we can greatly reduce the (perceived) risk of malicious contributions.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.