Linux :How to encrypt text file in Linux (VIM)

How to encrypt text file in Linux (VIM)

It is very easy to encrypt a text file in Linux, VIM text editor can be used to achieve it.. vim -x [file name]

[kartook@Nilas ~]$ vim -x kartook.txt

This will prompt us to enter encryption key (password)

Enter encryption key : ******
Enter same key again: ******

After that, key in the text data and save it. Now the “kartook.txt” text file is encrypted with my password.

Ok, let try to view the text file content

[kartook@Nilas ~]$ cat kartook.txt
VimCrypt~01!??PR?
??0?????$%^&*(        ?W#?Q?W?
(L??Y??
[kartook@Nilas ~]$

The text file content is encrypted with some alien code :) ,

Done, no body can view the content unless they know my encryption key.

How to change the encrypted password?

We can issue the following command (vim +X [file name]) to change the encrypted password.

[kartook@Nilas ~]$ vim +X kartook.txt
“mkyong.txt” [crypted] 1L, 37C
Enter encryption key: ***
Enter same key again: ***

Done

Possibly Related Posts:


Cisco’s offers borderless security

With a view to tackle today’s enterprise security challenges Cisco has evolved a new architecture for enterprise security that will help enable business users to access information from any device and any location with a high degree of ease and security, The Secure Borderless Network architecture focuses on four critical anchors: enterprise end-points (mobile or fixed), the Internet edge, the data centre, and policy that is context- and location-aware.

Tom Gillis, VP and general manager, Security Technology business unit, Cisco says, “The security needs of businesses are changing and becoming more complex, as more employees spend time out of the office accessing the corporate network via their smart phone or laptop. As a result, enterprises need a solution that will not hamper employee productivity, while helping to ensure that the network is not exposed to hackers, malware and other threats. AnyConnect Secure Mobility is the solution that our customers have been demanding, enabling them to strike that balance between providing consistent security and supporting access from individuals using any device to connect to the network from anywhere in the world.”

As the first proof point of this architecture, Cisco is releasing the Cisco AnyConnect Secure Mobility solution and expanding Cisco TrustSec to provide businesses with identity and granular control over policy to maximise persistent security and protection. This is especially important as workforces are increasingly mobile and are using new forms of Web-based collaboration and communication, making traditional security approaches insufficient.

Cisco AnyConnect Secure Mobility integrates functionality across the Cisco AnyConnect Secure Mobility Client, the Cisco IronPort S-Series Web Security Appliance and the Cisco Adaptive Security Appliance firewall. The next-generation remote access, advanced Web security and threat-intelligence capabilities of this solution helps allow enterprises to extend their corporate policy and controls to mobile users.

Alec Edworthy, Remote Access Service manager, Loughborough University, “Our mobile workforce has made securing our corporate network extremely challenging, as we have to support multiple brands of laptops and phones, as well as cloud-based applications. These business-critical communications must be as secure as possible no matter how and where our employees connect across the globe. Cisco clearly recognised that changes in where business takes place significantly expand the network security problems we face. Cisco’s AnyConnect Secure Mobility Solution gives us the confidence that we can improve our employees’ productivity by enabling them to work anywhere at any time, without sacrificing our security policies.”

Future plans call for extending the Cisco AnyConnect Secure Mobility solution to include hybrid enforcement delivered through the Cisco IronPort S-Series appliances and cloud-based security delivered through Cisco ScanSafe. By combining the end-point, the network and the cloud within one solution, Cisco will provide great flexibility and scalability for enterprises.

Anders Henriksson, networking department manager of TeleComputing says, “Cisco security technologies complement our focus on architecture and best practices to help secure our networks and data more effectively. Our company offers cloud computing services and our security policy requires 802.1X on LAN switches at customer premises for authentication. Cisco 802.1X technology not only allows us to implement our policy but it further helps us create and deliver the Managed LAN service for our customers.”

Possibly Related Posts:


Cybersecurity Experts: The FBI Wants You

FBI Director Robert Mueller sounded a call to arms at RSA, telling security experts that the country needs their help to fight cybercrime and terrorist attacks. He also enlisted the help of companies, promising greater sensitivity on the agency’s part when investigating breaches. “We know that putting on raid jackets, courting the media, and shutting down your operations does not get the job done,” he said.

The Federal Bureau of Investigation on Thursday joined the Department of Homeland Security in seeking to hire cybersecurity experts from the private sector.

“I want to send out an invitation to those of you in the audience who want to serve the country to join the FBI,” FBI Director Robert Mueller said at the RSA Conference 2010 in San Francisco on Thursday.

Mueller also urged the private sector to cooperate with the FBI in fighting cybercrime, as did DHS Secretary Janet Napolitano when she spoke at RSA 2010 on Wednesday.

Taking On More Staff

The FBI has cybersquads in each of its 56 fields nationwide, and more than 1,000 specially trained agents, analysts and digital forensic examiners who run complex undercover operations, share intelligence with partners in law enforcement and intelligence, and provide training to their counterparts around the world, Mueller said.

It also has mobile cyberaction teams — agents, analysts and experts highly trained in both computer forensics and malicious code — who travel worldwide to respond to fast-moving cyberthreats.

In addition, it has created and leads the National Cyber Investigative Joint Task Force, which combines 17 law enforcement and intelligence agencies to predict what’s on the horizon, to prevent attacks, and to pursue the enterprises responsible for planning them.

The FBI also has small groups of analysts and agents from different agencies who focus on different threats, Mueller said. For example, its botnet fusion focus cell investigates high-priority botnets, reverse engineers those botnets, and searches for their creators.

However, that’s not enough; the FBI is seeking to beef up the ranks of its cybersecurity experts.

“We — both you and I — serve the American people, and we must do everything we can together to minimize and stop these attacks,” Mueller said.

Stand By Me

Without support from the private sector, law enforcement will find it difficult to fight cybercrime, Mueller said.

“We need your help, so let me emphasize the importance of private sector partnerships,” he told his audience.

Mueller pledged that the FBI will minimize disruption to companies that report crimes.

“Historically, there has been a dichotomy between network security and the investigative process,” he pointed out. “We in the FBI understand you have practical reasons for being concerned about reporting breaches of security.”

The FBI doesn’t want enterprises to feel victimized a second time by an investigation, Mueller promised.

“We know that putting on raid jackets, courting the media, and shutting down your operations does not get the job done,” he said, echoing what he said in 2005 when he complained about the reluctance of the private sector to report cybercrime. “For every investigation in the news, there are hundreds that never make the headlines. Disclosure is the exception, not the rule.”

Private enterprises have been reluctant to report cyberattacks for fear that investigations will hurt their operations, a fact acknowledged by the U.S. Department of Justice and other law enforcement agencies.

“We will share with you what we can as quickly as we can about the means and the methods of the attacks,” Mueller said, “but we cannot act if we are not aware of the problem, and maintaining a code of silence will not help you or your clients in the long run.”

For example, the FBI managed to crack a crime ring that stole millions of dollars from more than 280 cities worldwide within 24 hours by using fake ATM cards because the company in question reported the crime, Mueller said.

“In 24 hours, the attackers stole hundreds of millions of dollars in more than 280 cities worldwide,” Mueller told his audience. “If the company hadn’t come forward, we could not have prevented these hackers from hitting their next victim.”

The top three hackers behind this attack are now in custody in eastern Europe, Mueller said.

A New World Cybersecurity Order

Fighting cybercrime effectively requires international cooperation among nations and law enforcement, Mueller pointed out. “Today, no one country, no one company, no one agency can stop cybercrime,” he explained. “We see borders as obstacles, whereas criminals see them as opportunities.”

Cybercriminal gangs cooperate easily across national borders, while law enforcement agencies cannot because of jurisdictional and legal issues and other differences. Some countries also protect well-connected cybercriminals.

The FBI has more than 60 attachés based in nations around the globe who share information and intelligence with their host countries, Mueller pointed out.

Cooperation between the FBI and Spanish authorities helped crack the Mariposa botnet and take down the three men behind it.

“This case, like so many others, emphasizes the need for global cooperation,” Mueller said.

The FBI has also cooperated with Egyptian authorities to dismantle an intrusion and money-laundering scheme, and with German and other authorities to dismantle “Dark Market,” one of the largest underground markets for stolen cyberinformation.

“Together we must work towards an international standard for dealing with cybercrime,” Mueller said. “We’re playing the cyberequivalent of cat and mouse, and the mouse seems to be one step ahead most of the time.”

Source

Possibly Related Posts:


Google opens Google Apps Marketplace

Google launched on Tuesday evening Google Apps Marketplace, providing a venue for third-party, cloud-based applications to supplement Google’s own online applications.

The program enables integrations with such applications as Google Gmail, Documents, Sites and Calendar. All told, the effort begins with 50 vendors participating, including Atlassian, NetSuite, Skytap and Zoho.

“Tonight, what we’re doing is we’re announcing a business-to-business marketplace for Google Apps users, where the idea is that we want to help users get more applications for Google Apps from third-party developers,” said Chris Vander Mey, Google senior product manager, in an interview on Tuesday afternoon. Among the applications is a small business payroll system from Intuit, called Intuit Online Payroll, and Box.net’s self-named content management system.

Users can link to an application via the UI in Google applications, offering benefits like single sign-on and sharing of data between Google Apps and third-party applications. Centralized administration also is featured.

“As you purchase applications, they’re automatically integrated into your domain,” Vander Mey said. Applications can be installed within a domain via a four-click process. Google Apps Marketplace could be compared to the Apple App Store for iPhone applications or the Salesforce.com Force.com cloud application platform, said Vander Mey.

At Box.net, an official cited integration benefits of Google Apps marketplace.

“Basically, we’re now pretty deeply integrated with Google Apps,” said Jennifer Grant, vice president of marketing at Box.net. Users can access Box.net directly from applications such as Gmail, she said.

“Before, they would have to go to Box.net as a separate application,” Grant said.  Users can add Google Docs documents to a Box.net workflow and send out email alerts.

Participation in Google Apps Marketplace is open to customers of the Premier, Standard and Education editions of Google Apps. Applications are linked to the marketplace via REST Web services and APIs including OpenID and OAuth.

“We expect [the marketplace is] going to significantly help Google Apps adoption and also help adoption of our partner apps,” Vander Mey said. “We’re going to bring 25 million users to these partner companies.”

Google began offering online applications five years ago, having reached the 25 million-user mark last weekend, said Vender Mey. More than 2 million businesses use the applications, he said.

Google will pass on 80 percent of revenues from Google Apps Market sales to participating partners and keep the remaining 20 percent.

Some of the other application partners include Aviary, Batchbook, Bookfresh, Expensify, OfficeSync, Shoeboxed.com, and SuccessFactors.

Possibly Related Posts:


FreeBSD : Data set and change

Display the date:

Simply type the date command to display the current date:

# date

Output:

Fri Mar  12 12:44:29 CST 2010

To set/change date:

To set the date, you need to simply use the date command followed by the year, month, day, hour, minute, and second … all numeric and no spaces.

To set the date with date command, you need to follow this format:

# date yymmddhhMMss

Possibly Related Posts:


Mysql : Connect to a remote mysql Server

At a shell or command (cmd for windows) prompt you type all one 1 single line:

mysql -u DB_USER_NAME -p[PASSWORD] DB_NAME -h DB_SERVER

with the following replacements of the terms above:

* Replace DB_SERVER with the correct database servername or IP address

* Replace DB_USER_NAME with your mysql username.

* Replace DB_NAME with your mysql databasename.

* [PASSWORD] is optional on command line, otherwise it will ask you to enter it later on

DB_USER_NAME = Kartook
DB_SERVER       = KartookShop.com
BD_NAME          = shop

mysql -u bip -p shop -h KartookShop.com

If you connecting to the same computer you can use host name will be localhost or with out any host name.

mysql -u Kartook -p shop

To Connect from PHP you use the below script:
we will query cust table and get customer name.


<?
$database = “DB_NAME”;
$hostname = “DB_SERVER”;
$username = “DB_USER_NAME”;
$password = ‘DB_PASSWORD’;

$link = mysql_connect($hostname, $username, $password);
mysql_select_db($database);

$SQL = “SELECT cust_name FROM cust;
$result = $link -> mysql_query($SQL,$link);

if (mysql_num_rows($result)> 0) {
while ($tmp = mysql_fetch_row($result))
echo  $tmp[0];
}

mysql_close($link);

?>

From Perl you can use the below script:

#!/usr/bin/perl
use DBI;
$database = “DB_NAME”;
$hostname = “DB_SERVER”;
$port = “3306″;
$username = “DB_USER_NAME”;
$password = ‘DB_PASSWORD’;

$dsn = “DBI:mysql:database=$database;host=$hostname;port=$port”;

$dbh = DBI->connect($dsn, $username, $password) or die(“Can not connect!”);

$SQL = “SELECT cust_name FROM cust”;

$result = $dbh->prepare($SQL);
$result->execute;

while(($column1, $column2) = $result->fetchrow_array)
{
print “C1 = $column1, C2 = $column2n”;
}

$dbh->disconnect;

Possibly Related Posts:


MySql : how to create database user on mysql databbase?

to create new user on mysql database we can use below script;

DB_NAME = KartookShop
DB_USER = Kartook
DB_PASSWORD = password
HOST=localhost

we want to give SELECT,INSERT,UPDATE,DELETE,CREATE,DROP permission on Kartook.


GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON KartookShop.* TO ‘Kartook’@'localhost’ IDENTIFIED BY ‘password’;

this will allow Kartook to connect to KartookShop database from localhost. If you want to give permission to connect remotely you need to update the user table or use “%” instead of localhost.


GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON KartookShop.* TO ‘Kartook’@'%’ IDENTIFIED BY ‘password’;

OR if user account already there and you want to give him remote access you need to update the user table.


mysql> use mysql;
Database changed
mysql> select host, user from user where user=’Kartook’;
+———–+——+
| host | user |
+———–+——+
| localhost | Kartook |
+———–+——+
1 rows in set (0.01 sec)
mysql> select host, user from user where user=’Kartook’;
+———–+——+
| host | user |
+———–+——+
| localhost | Kartook |
+———–+——+
1 row in set (0.00 sec)
mysql> update user set host=’%’ where user = ‘Kartook’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> select host, user from user where user=’Kartook’;
+——+——+
| host | user |
+——+——+
| % | Kartook |
+——+——+
1 row in set (0.01 sec)

Now user Kartook should be able to login remotely.

Possibly Related Posts:


MySql : How to Create a new database on MySQL?

How to Create a new database on MySQL?

To create a new database you need to login as root or a account that has permission.

we will create KartookShop database.

-> mysql -u root -p
mysql> create database KartookShop;
Query OK, 1 row affected (0.06 sec)

Possibly Related Posts:


Linux : Linux command line calculator

Here what bc, a command line calculator, comes in handy.
In this short tutorial, I will show how to do some basic calculation with bc.

First launch bc by typing bc and hitting enter. You will see bc ready to take your commands.

[root@kartook ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty’.
18+18
36

100-99
1

100*100
10000

10*2-100+52
-28

Possibly Related Posts:


FreeBSD :How do I disable desktop icons for “Computer,” “Home,” and “Trash?”

How do I disable desktop icons for “Computer,” “Home,” and “Trash?”

If you do not want your desktop cluttered with the default icons for “Computer,” “Home,” and “Trash,” you can disable any or all of them. To do this, launch Applications > System Tools > Configuration Editor (gconf-editor from the command line), and go to the /apps/nautilus/desktop key.

From here, you can enable or disable the icons, and even rename “Home” and “Trash.”

Possibly Related Posts: