Categories
Uncategorised

Text Files – Change Characters

/* Copyright (C) 2007 Ankur Banerjee. This program is free software: you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For a copy of the GNU General Public License see http://www.gnu.org/licenses/gpl.html /

/ Text Files – Change characters after taking text file input from use and use function change() to replace alphabets. Replace alphabets and digits with the next one and all spaces with ‘-‘ /

#include <fstream.h>
#include <stdio.h>
#include <conio.h>

fstream obj(“text.txt”, ios::out);
fstream obj2(“new.txt”, ios::out);
char s[1001], ans, ch;

void change()
{
obj.open(“text.txt”, ios::in);
while ( !obj.eof() )
{
ch = obj.get();
if (ch == ‘z’)
ch = ‘a’;
else if (ch == ‘Z’)
ch = ‘A’;
else if (ch == ‘ ‘)
ch = ‘-‘;
else if (ch == ‘9’)
ch = ‘0’;
else if ((ch >=’a’&&ch<= ‘y’) || (ch >= ‘A’ && ch <= ‘Y’) || (ch >= 0 &&ch <=8))
++ch;
obj2<<ch;
}
obj.close();
obj2.close();
}

void main()
{
clrscr();
do
{
cout<<endl<<“Enter data (max 1000 characters) : “;
gets(s);
obj<<s<<‘\n’;
cout<<“Do you wish to continue (y / n) : “;
cin>>ans;
} while (ans == ‘y’);
obj.close();
change();
obj.open(“text.txt”, ios::in);
obj2.open(“new.txt”, ios::in);
cout<<endl<<“Old file is”<<endl;
while ( !obj.eof() )
{
ch = obj.get();
cout<<ch;
}
cout<<endl<<“New file is”<<endl;
while ( !obj2.eof() )
{
ch = obj2.get();
cout<<ch;
}
obj.close();
obj2.close();
getch();
}

/ Output */

Enter data (max 1000 characters) :
The Answer to Life, the Universe, and Everything is 42
Do you wish to continue (y / n) : y
Enter data (max 1000 characters) : The 9th Law of WSOGMM states that the Great Prophet Zarquon will come again
Do you wish to continue (y / n) : n

Old file is
The Answer to Life, the Universe, and Everything is 42
The 9th Law of WSOGMM states that the Great Prophet Zarquon will come again

New file is
Uif-Botxfs-up-Mjgf,-uif-Vojwfstf,-boe-Fwfszuijoh-jt-42
Uif-0ui-Mbx-pg-XTPHNN-tubuft-uibu-uif-Hsfbu-Qspqifu-Absrvpo-xjmm-dpnf-bhbjo

Categories
Technology

DPS VK Site A ‘Malware Hub’?

I came across this post on Naman’s blog recently – about potential problems with the DPS Vasant Kunj site! Boy did he make an important finding, because if this is serious, then action needs to be taken quick.


Search for dpsvasantkunj.com on Google, and you’ll find the malware warnings. Going to StopBadware.org elaborates that the site ‘hosts or distributes badware’. Strangely, siteadvisor.com found ‘no major problems’ with our school site.

I guess what has happened is that some files must have been uploaded to the school site which had been infected, because virus infestations are a major problem in our school networks. And why shouldn’t it be, because the anti-virus on most computers is hardly ever updated. Plus, there’s no firewall running on the school server, and the Internet lab, the main access point of the school to the Big Bad Outside World, still runs Windows 2000. Those bloody machines splutter to death on loading any good anti-virus because they’re old Pentium IIIs with hardly any RAM at all. And guess what happens when you use an operating system so old and with so many security loopholes? Major disaster.

The school NEEDS to get its act together. Already, work is in progress to set up a computerised question paper and assignments database, along with student records at DPS VK. If such vulnerabilities exist in the network, school data could get compromised in a major way.