What do I need to know to write a client server socket program in Java using Caesar Cipher authentication?
I have an assignment called "Write a client server socket program in Java in which server will authenticate clie开发者_如何学Gont using authentication algorithm." How do I get started? Which are the prerequisites of knowledge of computer security and socket programming to implement this? Any links to good tutorials?
EDIT: Using Caesar Cipher
Maybe this can help you:
http://www.javaworld.com/jw-12-1996/jw-12-sockets.html
The authentication can be a simple username/password scheme.
Sockets
Authentication Algorithm
This requirement is vague. I will give you the simplest possible answer:
write the server in such a way, that it requires a username and password with every request.
Are your using an authentication algorithm or are you just encrypting the message?
If you just have to encrypt the message then make sure both ends have the same cypher stored in them (Two arrays of characters should work ) and encrypt the string character by character before you send the message then decrypt it character by character on the other end.
You don't use a Caesar Cypher for authentication merely encryption. If you want authentication then separately you can have the first message of the socket connection be a username/password both of which you can encrypt client side and decrypt server side, then check they are valid. For the simplest example of this just hard code an acceptable username and password on the server and have the username and password on the client be entered on the command line.
For anybody that Googled their way here, an example of an authentication algorithm or "handshake" is more than a username
and password
. It would be a challenge sent from the server to the client, such as a random string; and the client performs an algorithm on the challenge, such as bit wise operations for example, and sends it back to the server. The server then does this same thing to the challenge and compares with the one the client sent before verifying the log in.
This is used to create a more arcane protocol to deter 3rd party developers such as bot makers from creating unauthorized software. Often times the handshake procedure is very difficult, not only in operation but also using complex functions of the used language to make porting very difficult.
精彩评论