Preferred way to use Libsodium in Golang?

agolangf · · 465 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Following the news of <a href="https://www.privateinternetaccess.com/blog/2017/08/libsodium-v1-0-12-and-v1-0-13-security-assessment">the successful audit of Libsodium</a>, what is the preferred way to use Libsodium from within Golang? I see 3+ projects on Github that claim to wrap Libsodium for Golang, but they seem to be in various states of incompleteness. In particular, it would be preferable to use actual Libsodium, rather than golang.org/x/crypto/nacl, since the former has now been audited and the latter I&#39;m not aware of being so.</p> <p>Thanks in advance.</p> <p>P.S. I don&#39;t mean to imply that I have any reason not to believe golang.org/x/crypto/nacl is secure or anything like that. I only mean that Libsodium is explicitly recommended by security professionals and now has explicitly been audited.</p> <hr/>**评论:**<br/><br/>tv64738: <pre><p>I for one trust Adam Langley more than whatever CGo wrapper for Libsodium you can find. Use golang.org/x/crypto.</p></pre>jeffrallen: <pre><p>Before continuing on this path with the reasoning &#34;this C library is audited, so I should use cgo to use it&#34;, please read this article: <a href="https://dave.cheney.net/2016/01/18/cgo-is-not-go">https://dave.cheney.net/2016/01/18/cgo-is-not-go</a></p> <p>It might be that using libsodium via cgo is right for you, but in general, cgo should be your last option, not your first.</p></pre>George3d6: <pre><p>There&#39;s no point in re-writing a library from C to Go if said library already works. So I don&#39;t see you point for not using cgo here.</p></pre>jeffrallen: <pre><p>If you read Dave&#39;s article and you still think that, then ok, let&#39;s agree to disagree.</p></pre>hobbified: <pre><p>You link someone to something, they reply to it, and you start off <em>questioning</em> whether they actually read it?</p></pre>jedisct1: <pre><p><a href="https://github.com/GoKillers/libsodium-go" rel="nofollow">https://github.com/GoKillers/libsodium-go</a> appears to be the most up-to-date and the most well-maintained.</p> <p>And CGo is not evil.</p></pre>samsonx: <pre><p>Build libsodium yourself and create a dynamic library (dll/dylib/so) then use it directly from golang.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

465 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传