Ruby: file encryption/decryption with private/public keys

前端 未结 4 1014
醉话见心
醉话见心 2020-12-05 04:53

I am searching for an algorithm for file encryption/decryption which satisfies the following requirements:

  • Algorithm must be reliable
  • Algorithm should
4条回答
  •  无人及你
    2020-12-05 05:29

    Symmetric Encryption is definitely fast and has excellent support for streaming of very large files.

    SymmetricEncryption::Writer.open('my_file.enc') do |file|
      file.write "Hello World\n"
      file.write "Keep this secret"
    end
    

    Symmetric Encryption is designed for encrypting data and large files within an organization.

    When it comes to sharing files with other organizations then the best option is PGP. For streaming of very large files with PGP consider: IOStreams

    IOStreams.writer('hello.pgp', recipient: 'receiver@example.org') do |writer|
      writer.write('Hello World')
      writer.write('and some more')
    end
    

    Look at the file iostreams/lib/io_streams/pgp.rb for more PGP examples. It also supports PGP key management directly from Ruby.

提交回复
热议问题