Information on encryoption and security for a LAN chat program

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Hexen
Posts: 2
Joined: 10 Dec 2017 08:14

Information on encryoption and security for a LAN chat program

#1 Post by Hexen » 10 Dec 2017 08:28

Hello everyone,

Iv'e recently started a project and am using a code that someone has typed up for a basic LAN chat program. Its pretty basic but I rekon there is a lot more room for improvment, im just wondering what the actual scope could be when it comes to writting DOS batch files. Im used to writting in HTML and python when compared with this the coding looks extremely simple to follow, but I still don't understand the syntax all to well.

Im not a very experuienced programmer, but always love to l;earn and explore and deepen my understanding of what I believe to be more of an art form and a skill than anything else. This project is to set up a LAN chat service in my office building so my teams and development guys can communicate using an offkline, networked method. Security is an absolute must in this matter. So my questions are this;

1) What encryption methods could be used to secure the user and password information from other users in the network, including making the filling out of the password itself turn into *** instead of typing out the password and having it visible?

2) Have the user box where messages are typed display the users name instead of just saying usder. The users name who sends a message which is displayed is shown, but the actual; chat box just says user rather than personalize it to the users assigned username.

3) Any other ideas which could make this program opperate to professional standards or other programming concepts which would make the program better.

I would like for this to be something that could always be improved and update upon, just like most software topday can be, im sure with this its no differern't.

As i said im not an expereicned programmer, I just own and run a small business but programming is a little hobby of mine. I will post the code for both sets of programs below and attach the zip file to this post incase you wanted to have a look over all of the files.

Thanks for reading

First set of code (displays the login creation and login features as well as the typing box for messages.

Code: Select all

@echo off
:Menu
Set Num=1
color 0b
title A-Terminal
cls

Echo {A-Terminal}
Echo ________________________________________________________________________________________________________________________________________________________________
Echo.
Echo 1.) Login
Echo.
Echo 2.) Create a Account
Echo.
Echo 3.) Exit
Echo.
Echo ________________________________________________________________________________________________________________________________________________________________
Echo.

Set /p Num=Choice Number:

if %Num%==1 Goto Login
if %Num%==2 Goto Create
if %Num%==3 Goto

color 0c
Echo.
Echo You entered a invalid number choice please try again.
ping localhost -n 4 >nul

Goto Menu


:Login
cls
Echo Enter your Username, and Password to login into the server
Echo.
Set /p UN=Username:
Echo.
Set /p PW=Password:
Echo.

if NOT Exist "C:\Users\Public\Chat room\Chat Settings\Users\%UN%.info" Goto Failed 
echo %PW% >"%tmp%\chat.tmp"
fc "%tmp%\chat.tmp" "C:\Users\Public\Chat room\Chat Settings\Users\%UN%.info" >nul
if errorlevel==1 goto Failed
if errorlevel==0 goto Chat


:Create
cls
color 0b

Echo Enter a Username for your new account, and a Password for your new account.
Echo.
Set /p NU=New Username:
Echo.
Set /p NP=New Password:
Echo.
Echo %NP% >"C:\Users\Public\Chat room\Chat Settings\Users\%NU%.info"
cls
Goto Login


:Failed
color 0c
cls
Echo. You have entered a invalid Username, or Password please try again if you do not have a account please make one it is free.
ping localhost -n 6 >nul
goto Menu

:Chat
set name=%UN%
cls
color 0b
set /p text=User:

echo %name% : %text% >>"C:\Users\Public\Chat room\Chat Settings\Program_Files\ChatHistory.info"
ping localhost -n 1 >nul
goto chat

_________________________________________________________________________________________________________________________________________
Second code - displays the mnessage history in real time as well as creating a message histiory test file in the chat settings > program files folder

@echo off
color 0b
cls
title Message Box
:home
cls
findstr /v "g91dhjt637hsuexv27niw9" "C:\Users\Public\Chat room\Chat Settings\Program_Files\ChatHistory.info"
ping localhost -n 3 >nul
goto home
Attachments
Chat Program.zip
(2.38 KiB) Downloaded 237 times
Last edited by aGerman on 10 Dec 2017 08:36, edited 1 time in total.
Reason: Code tags added

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Information on encryoption and security for a LAN chat program

#2 Post by aGerman » 10 Dec 2017 08:41

Hexen wrote:
10 Dec 2017 08:28
1) What encryption methods could be used to secure the user and password information from other users in the network, including making the filling out of the password itself turn into *** instead of typing out the password and having it visible?
See the Hidden_Input.bat code:
viewtopic.php?f=3&t=5519&p=33741#p33741

Steffen

Hexen
Posts: 2
Joined: 10 Dec 2017 08:14

Re: Information on encryoption and security for a LAN chat program

#3 Post by Hexen » 10 Dec 2017 08:42

Thankyou very much, I will take a good look over it this afternoon!

Post Reply