Encryption Security Standards in Ruby
I'm looking to do encryption where "the client" uses a publicly available key from "the server" to encrypt a message that will be seen by "the enemy". It is important that "the enemy" is not able to decipher the message. Furthermore, "the enemy" will be responsible for delivering the encrypted message and "the server" must be able to detect if the message been tampered with. Lastly, it is important that "the client" is not be able to determine the private key of the server (based on how the message is encrypted; although I think this goes without saying).
I'm looking to do it in Ruby and I'm very out of touch with modern security and encryption meth开发者_运维问答ods. Any getting started hints, links or snippets would be appreciated! Thanks.
That sounds a lot like RSA combined with a symmetric-key block cipher if the message is longer than the key length. That, and what you seem to be looking for, also pretty much describes how PGP works.
I haven't used it myself but there's an OpenPGP Ruby gem for that.
$ sudo gem install openpgp
There's is chilkat library that can help you with encryption. Check this site for different encryption snippets in ruby http://www.example-code.com/ruby/encryption.asp
Also these gems might help http://ezcrypto.rubyforge.org/
http://crypt.rubyforge.org/
精彩评论