# SQLCypher -how to integrate custom algorithm?

**URL:** <https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992>\
**Category:** SQLCipher\
**Created:** [August 2, 2018, 7:45am UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992 "2018-08-02T07:45:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bshedrinsky](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bshedrinsky](https://discuss.zetetic.net/u/bshedrinsky)\
**Post date:** [August 2, 2018, 7:45am UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992/1 "2018-08-02T07:45:53Z")

</div>

We need to use custom algorithm to encrypt data in our db. Is there an interface where we can inject our own?

If not, any ideas on how to approach this task?

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [August 2, 2018, 1:15pm UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992/2 "2018-08-02T13:15:40Z")

</div>

Hi @bshedrinsky

Are you referring to using a different cipher, or something else?

---

<div class="post-metadata">

**Author:** ![bshedrinsky](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bshedrinsky](https://discuss.zetetic.net/u/bshedrinsky)\
**Post date:** [August 2, 2018, 3:11pm UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992/3 "2018-08-02T15:11:37Z")

</div>

Correct. No a standard cipher, our own

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [August 2, 2018, 3:24pm UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992/4 "2018-08-02T15:24:27Z")

</div>

Hi @bshedrinsky

If I may ask, what cipher are you looking to utilize? Can you share why AES-256 in CBC mode does not fit for your requirements?

---

<div class="post-metadata">

**Author:** ![bshedrinsky](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bshedrinsky](https://discuss.zetetic.net/u/bshedrinsky)\
**Post date:** [August 2, 2018, 4:15pm UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992/5 "2018-08-02T16:15:20Z")

</div>

We’re looking to integrate CryptoPro cipher, which is Russian standard [https://cryptopro.ru/](https://cryptopro.ru/)

Thank you!

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [August 2, 2018, 8:35pm UTC](https://discuss.zetetic.net/t/sqlcypher-how-to-integrate-custom-algorithm/2992/6 "2018-08-02T20:35:04Z")

</div>

Hi @bshedrinsky

You would need to implement and register your own `crypto_provider`. An example of our OpenSSL crypto provider can be found [here](https://github.com/sqlcipher/sqlcipher/blob/master/src/crypto_openssl.c).
