encrypt file with SHA256 using C/C++

陌路散爱 提交于 2019-12-13 09:46:34

问题


How can I encode a file using sha256 and c/c++ ??? Thanks!


回答1:


SHA 256 stands for Secure Hash Algorithm ! It will only produce the hash of a given file . You can't retrieve the original file from a given hash otherwise hash functions are useless.

If you want to do encryption/decryption AES would be a better solution. Everything you need is in OpenSSL.




回答2:


If you don't know what SHA is for, then you better ask someone who knows this stuff instead of doing it yourself. Even if you use a given library, chances are very high that you will produce snake oil. Security depends on much more than calling some encryption functions.



来源:https://stackoverflow.com/questions/2486887/encrypt-file-with-sha256-using-c-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!