[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Obfuscating/suppressing password output in TCPSocket?

Nate Smith

3/9/2006 8:46:00 PM

Hello,

I'm attempting to suppress the output of a password that is sent via
a TCPSocket. If I have the following code:

server = TCPServer.new( '127.0.0.1', 8888 )
socket = server.accept() # socket is now a TCPSocket
password = socket.gets()

is there a simple way to suppress the password on the client side
(I.E., turn off client-side echoing of the password)? I know there is
a way to do this with sockets in C, but can't figure out a way with
TCPSocket. Thanks!

Nate



5 Answers

Bernhard 'elven' Stoeckner

3/9/2006 9:41:00 PM

0

Nate Smith scribbled on Thursday 09 Mar 2006 21:46:

> Hello,
>
> I'm attempting to suppress the output of a password that is sent via
> a TCPSocket. If I have the following code:
>
> server = TCPServer.new( '127.0.0.1', 8888 )
> socket = server.accept() # socket is now a TCPSocket
> password = socket.gets()
>
> is there a simple way to suppress the password on the client side
> (I.E., turn off client-side echoing of the password)? I know there is
> a way to do this with sockets in C, but can't figure out a way with
> TCPSocket. Thanks!
>
> Nate

You'd need to implement the telnet protocol and make your peer use a telnet
client in order to implement noecho.

Edward Faulkner

3/9/2006 10:32:00 PM

0

On Fri, Mar 10, 2006 at 05:46:12AM +0900, Nate Smith wrote:
> is there a simple way to suppress the password on the client side
> (I.E., turn off client-side echoing of the password)? I know there is
> a way to do this with sockets in C, but can't figure out a way with
> TCPSocket. Thanks!

The issue isn't with sockets, it's with the client terminal. You need
to manipulate the terminal settings. I see ruby-password and
ruby-termios packages on RAA that might do what you want.

http://raa.ruby-lang.org/project/ruby-pass...

regards,
Ed

Nate Smith

3/10/2006 6:11:00 AM

0

Hello,

I created a server, accepted a connection via telnet, and if the
client sends a control-c, the TCPSocket hangs. It can still read
data, but writing to it produces no output on the client side. Here's
the code:

server = TCPServer.new( '127.0.0.1', 31337 )
socket = server.accept

# now client (via telnet), sends control-c

socket.print "test" # <-- produces no output on client

Anyone know what's up? I checked for exception throws and there are
none, and the server side keeps running normally, besides this.

Nate



Nate Smith

3/10/2006 6:29:00 AM

0

Sorry, the code should look like:


server = TCPServer.new( '127.0.0.1', 31337 )
socket = server.accept

data = socket.gets # added this line
# now client (via telnet), sends control-c

socket.print "test" # <-- produces no output on client



On Mar 9, 2006, at 10:10 PM, Nate Smith wrote:

> Hello,
>
> I created a server, accepted a connection via telnet, and if the
> client sends a control-c, the TCPSocket hangs. It can still read
> data, but writing to it produces no output on the client side.
> Here's the code:
>
> server = TCPServer.new( '127.0.0.1', 31337 )
> socket = server.accept
>
> # now client (via telnet), sends control-c
>
> socket.print "test" # <-- produces no output on client
>
> Anyone know what's up? I checked for exception throws and there are
> none, and the server side keeps running normally, besides this.
>
> Nate
>

conwaycaine

11/29/2010 2:23:00 PM

0


"WhiteWolf! @iol.ie" <rayh(removespamblocker> wrote in message
news:mob7f6lklukf5vphpf095pp3j922mbernb@4ax.com...
> On Wed, 24 Nov 2010 09:51:13 -0500, "conwaycaine"
> <conwaycaine@bellsouth.net>

>>>>And what is even more amazing, in spite of these rather severe
>>>>limitations,
>>>>my oldest grandson can pop me in the head at ranges up to 150 feet.
>>>>
>>>
>>> Doesn't that hurt like a lot? You need a helmet around your house! :)
>>
>>Of course it hurts.
>>But when I consider the absolute glee it brings to my grandson, well worth
>>it!!!
>>
>>
>
> Better you than me. :)

I'll bet you have no grandsons......................
;=)