> For the complete documentation index, see [llms.txt](https://docs.optimumsec.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.optimumsec.xyz/coding/use-cryptographic-libs.md).

# Use Cryptographic Libraries

In Solidity, verifying signatures is a crucial part of ensuring that only authorized parties can perform specific actions in a smart contract. Instead of writing custom signature verification logic, developers should rely on well-established [cryptography libraries](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/utils/cryptography).

These libraries have been thoroughly tested and are less likely to contain critical bugs that could lead to exploits, such as unauthorized access or fraudulent transactions. Issues around `ecrecover`, like signature malleability or improper error handling, as well as potential integration bugs with ERC-1271 signatures, are also addressed by these libraries.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.optimumsec.xyz/coding/use-cryptographic-libs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
