[SOLVED]How to use `lua-resty-nettle` lib in kong plugin?

#1

I want use des func of lua-resty-nettle, but kong start up failed with local des = require "resty.nettle.des" . :joy:

#2

You need to install lua-resty-nettle:
e.g. luarocks install lua-resty-nettle

And you need to install nettle system lib:
e.g. brew install nettle

(if doing manually, you will also need gmp for bignum functions, e g. rsa).

#3

Thank you very much! But I only want decrypt my token by des method in kong plugin. we can’t install nettle in our system. Is there any way can directly used?

#4

Can you install libnettle.so anywhere? If so you can specify where it is searched:
_NETTLE_LIB_PATH = "/usr/local/kong/lib/"