Encrypted Client

Encrypted Client

RSA_client.rb

Three principles are commonly used when describing information technology and security. The three principles are confidentiality, integrity, and availability. Each of these security components affects how a user interacts with data. The following two scripts will integrate RSA encryption for confidentiality and a SHA1 hash for integrity. The data will then be transmitted over a network using a TCP connection.

The Code

 require 'socket'
 require 'digest/sha1'

 begin
     print "Starting client..."
     client = TCPSocket.new('localhost', 8887)

     puts "connected!\n\n"

 temp = nil 5.times do temp << client.gets end puts ...

Get Wicked Cool Ruby Scripts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.