# Using Openssl to implement cryptography

**URL:** <https://mangoh.discourse.group/t/using-openssl-to-implement-cryptography/9107>\
**Category:** Uncategorized\
**Created:** [May 2, 2021, 10:09pm UTC](https://mangoh.discourse.group/t/using-openssl-to-implement-cryptography/9107 "2021-05-02T22:09:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyzhang](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jeremyzhang](https://mangoh.discourse.group/u/jeremyzhang)\
**Post date:** [May 2, 2021, 10:09pm UTC](https://mangoh.discourse.group/t/using-openssl-to-implement-cryptography/9107/1 "2021-05-02T22:09:19Z")

</div>

Hi,

I’m writing a program to transmit SMS message on WP7702, I would like to encrypt the message before it is transmitted over the network. I wonder how can I use openssl lib on Legato?  
sample code would be very helpful!!

Thanks

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 3, 2021, 1:10am UTC](https://mangoh.discourse.group/t/using-openssl-to-implement-cryptography/9107/2 "2021-05-03T01:10:22Z")

</div>

you can see this document:

[SSL in Legato application.docx](https://mangoh.discourse.group/uploads/short-url/nXwCIOCq7GsLlnqqSgjAAZnQNyy.docx) (464.9 KB)

---

<div class="post-metadata">

**Author:** ![jeremyzhang](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jeremyzhang](https://mangoh.discourse.group/u/jeremyzhang)\
**Post date:** [May 7, 2021, 7:48pm UTC](https://mangoh.discourse.group/t/using-openssl-to-implement-cryptography/9107/3 "2021-05-07T19:48:22Z")

</div>

Hi I tried to run the sample code you posted, but I got the following error:

> May 7 12:19:35 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[1050]/supervisor T=main | app.c CreateFileLink() 2042 | Could not stat file at ‘/lib/libcrypto.so.1.0.0’. No such file or directory  
> May 7 12:19:35 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[1050]/supervisor T=main | app.c CreateFileLink() 2159 | Failed to create link at ‘/lib/libcrypto.so.1.0.0’ in app ‘ssltest’.

this is the .cdef file:

> sources:
> 
> {  
> main.c  
> }
> 
> requires:
> 
> {  
> lib:
> 
> ```
> {
> ssl
> crypto
> }
> 
> file:
> 
> {
> 
> // Make the library available inside the app sandbox (in the app's /lib directory).
> /usr/lib/libssl.so.1.0.0 /lib/
> /lib/libcrypto.so.1.0.0 /lib/
> }
> 
> ```
> 
> }

I manually checked /usr/lib, could not find libssl.so.1.0.0 nor libcrypto.so.1.0.0

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 7, 2021, 11:01pm UTC](https://mangoh.discourse.group/t/using-openssl-to-implement-cryptography/9107/4 "2021-05-07T23:01:20Z")

</div>

you can use these in .cdef file

/usr/lib/libssl.so.1.0.2

/usr/lib/libcrypto.so.1.0.2
