On linux system user information are stored in /etc/passwd. This file is world-readable (readable by any user of the computer system, even nobody) So it zonealarm extreme security extend is not a good idea to keep user passwords in it, even encrypted password.
The need to store (encrypted) password introduces the shadow file, which is /etc/shadow. It contains the zonealarm extreme security extend password which has been encrypted with the salt, which is also in the zonealarm extreme security extend shadow file.
contain of shadow file could be as follow:
luana:$1$TaORQ38u$Mfaih1b244CcesjU7Sj2T1:13975:0:99999:7:::
here, luana is the username
$1$ indicates we’re using a salt (TaORQ38u) and md5sum is being used to encrypt the key, $ signifies the beginning of the encrypted password (Mfaih1b244CcesjU7Sj2T1) and ends before :
2. Salt
salt is a string, publicly available (if you can see encrypted passwords you can see the salt), used to zonealarm extreme security extend help with the password encryption process. Since encryption is a on-to function (or a surjection - see http://mathworld.wolfram.com/Surjection.html) two of the zonealarm extreme security extend same words will encrypt to the same ciphertext. This means on a zonealarm extreme security extend system with very large amount of user there will be a zonealarm extreme security extend chance someone will use some very bad passwords (like “password” etc) and it will shows as two identical ciphertext in the shadow file.
Salt is zonealarm extreme security extend mostly unique to each user. It is often the encryption of the zonealarm extreme security extend time the user is added to the system (thus relatively unique for each user). This salt is zonealarm extreme security extend mixed with the user password before we start the encryption. This means for zonealarm extreme security extend any given two users it is extremely unlikely that they are zonealarm extreme security extend BOTH added to the system at the same time and use the zonealarm extreme security extend same password.
Simply put, salts allow the zonealarm extreme security extend system to afford users to use the same passwords without having two identical encrypted passwords in its password file.
3. Note about writing programs on linux that uses crypt()
crypt is standard to most c/c++ compilers on linux system. This means you don’t even have to do #include <> in your program to use these functions.
Example program:
#include <iostream>
int main()
{
std::cout<<crypt(”kccL;pw_d:”,”$1$TMVRB39B”);
return 0;
}
When compiled on linux system (with GNU cryptography library installed) you would run:
[lubox@neo 3]$ g++ hw3.cpp -o o -lcrypt
Notice the zonealarm extreme security extend -lcrypt option at the end. This will tell the compiler that zonealarm extreme security extend you are using crypt function.
The above program when run will yield output:
$1$TMVRB39B$PUaDAsZctLWtj0kteqvBe1
with the zonealarm extreme security extend salt the same, and the password is encrypted into the preceding bold part.
4. …
]]>For COMP 2103 the test will cover chapter 4.5, 4.6 and all of 5 (follow the SLIDE numbering, not the book).
Tuesday April 1st: I will go over 4.5 and 4.6 (review). You will be turning in three assignments . We go to zonealarm extreme security extend computer lab to demonstrate your program. I will grade and zonealarm extreme security extend return Thursday so you can review for your test.
Thursday April 3rd: Last class before your zonealarm extreme security extend test. We will go over Chapter 5. Make sure you have your questions ready.
For COMP 3053
Your test will cover chapter 5 and 6 on the 8th of April.
Tuesday April 1st: You’re turning in Assignment 7
There will be zonealarm extreme security extend an in-class assignment on this day so make sure you zonealarm extreme security extend don’t miss class. This assignment is zonealarm extreme security extend on your slide, about breadth-first and depth-first search.
On Thursday we will cover chapter 6 (Gaussian elimination, horner’s rule…)
Dr. R’s cellphone number:
1-281… you didn’t actually think I was going to zonealarm extreme security extend put his cell phone on the internet, did you?
]]>For Mathematic major, after you zonealarm extreme security extend take all your Calculus and basic linear algebra you’d advance to zonealarm extreme security extend Advanced Calculus. Advanced Calculus is quite a big leap from the zonealarm extreme security extend “normal” mathematics you’ve been studying so far. Now you’re not learning mathematics to zonealarm extreme security extend solve an equation, to find a value or evaluate an expression anymore. In Advanced Calculus (senior level courses at most College and Universities in America) you zonealarm extreme security extend will learn about series and sequences and their properties and more. You’d be exposed to thinking very very fine (small) and zonealarm extreme security extend also accept values and concepts that is larger than the zonealarm extreme security extend largest thing you know so far.
It’s a zonealarm extreme security extend big leap in understanding and requires a mature mind capable of abstract thinking. After you zonealarm extreme security extend master the basics of sequences, convergence… of Advanced Calculus you’d be zonealarm extreme security extend ready for the next step that is beginning Analysis. Intro to zonealarm extreme security extend Analysis is a course designed to bridge the gap from zonealarm extreme security extend Undergraduate Mathematics to a Graduate level training in the field. It’s abstract, it’s hard, it’s fun, it’s not compact(!)… you either get it or you don’t sort of thing.
This writing is about a classical problem in analysis. It’s would be zonealarm extreme security extend quite straightforward to some people while does not seem “logical.” Your common sense may work for zonealarm extreme security extend you or against you in this case. Let’s see…
——————————————————————————————
There is this hotel called Hotel Infinity. It has infinitely many rooms. Each of these rooms already has zonealarm extreme security extend a guest in it. Now a new guest arrive.
None of the zonealarm extreme security extend guests at the hotel will share a room with anyone. And no zonealarm extreme security extend one is leaving either.
So how do you accommodate the new comer? Or can you accomodate him at all?
Logically (common sense perhaps?) if every single room in the zonealarm extreme security extend hotel is filled then we can say the hotel is zonealarm extreme security extend full! Meaning no more guests can be accommodated? Well but that’s the zonealarm extreme security extend logic for a normal hotel, this is Hotel Infinity where we have zonealarm extreme security extend infinitely many rooms remember? Having all the rooms filled and “NO VACANCY” is two very different thing here.
To accept this zonealarm extreme security extend solution you must first accept that Hotel Infinity has infinitely many rooms. This IS the zonealarm extreme security extend key. Infinitely many rooms means it WILL NEVER RUN OUT OF ROOMS (whether the newest room found has a guest in it or not).
To accommodate the zonealarm extreme security extend new guest, you would tell the guest in room1 to move to zonealarm extreme security extend room 2. Guest in room 2 move to room 3, room 3 move to zonealarm extreme security extend room 4 and so on. You tell guest in room n to move to room number n+1 and zonealarm extreme security extend son on. Because you have infinitely many rooms there will always be zonealarm extreme security extend a room for everyone to move in to. By doing this zonealarm extreme security extend you have just freed up room 1! Now just send the new guest to this room
Yes you zonealarm extreme security extend just check a guest into a hotel where all the rooms are zonealarm extreme security extend filled! Let your imagination roams
The problem is extended when Continue’Em Tours send there entire fleet of buses to zonealarm extreme security extend your hotel. Their fleet has infinitely many buses each carrying infinitely many guests… You own Hotel Infinity, you can accommodate a lot (understatement) of people. But how do you accommodate Continu’Em Tours guests?
]]>This is zonealarm extreme security extend 5th grade arithmetic. We all know how this multiplication works. Let’s look at the first row (1).
3 times 8 = 24 we write 4 and “save” 2.
3 times 2 = 6 we dump the 2 saved from the previous round so we write 8.
and so on.
But, why did we save 2 from 24?? When we first learn this multiplication at 5th grade I don’t think any of us ask this zonealarm extreme security extend question. The reason is being you are working with decimals (base of 10). Meaning the zonealarm extreme security extend digit 1 space to the left of the least significant bit (LSB) means how many 10s the zonealarm extreme security extend value has. The digit 2 spaces to the left of the zonealarm extreme security extend LSB means how many hundreds you have, and so on.
so for 1291 :
you have 1000 + 200 + 90 + 1
or simply, as agreed upon in base of 10, to be written as 1291.
Now, this is definitely not the only way to represent number! For some odd reason you would like to write 1291 in say.. base 5!
The answer is 20131
To verify you can see:
2*5^4 + 0*5^3 + 1*5^2 + 3*5 + 1*5^0
= 2*625 + 0*125 + 1*25 + 3*5 + 1
= 1291
Please take my word for zonealarm extreme security extend it that this representation of 1291 decimal in base 5 is zonealarm extreme security extend unique (it is). Now our question would be zonealarm extreme security extend if the multiplication method we learned from 5th grade still work on number of a zonealarm extreme security extend base other than 10? Let’s consider a small example of multiplying 29 x 67 (decimals).
29 (base 10) = 104 (base 5)
67 (base 10) = 232 (base 5)
. 104
. x
. 232
. ————
Remember back in decimal everytime we have zonealarm extreme security extend something larger than 10 (or the base) we do a carry out (or “save” or “remember”)? It is zonealarm extreme security extend the same thing here. But instead of 10, everytime you have zonealarm extreme security extend something larger than 5 you have to carry out 1 for zonealarm extreme security extend each “5″ you have over.
so for 2 x 102:
2×4 = 8 write 3 carry 1
2×0 = 0 write 0 + 1 = 1
2×1 = 2 write 2
so for the first round we have
. 104
. x
. 232
————-
. 213
Similarly for the other 2 operations we end up with this multiplication:
. 104
. x
. 232
————-
. 213
. 322
. 213
————-
. 30233
For the zonealarm extreme security extend final step of adding the 3 values together. When you zonealarm extreme security extend add 2+2+3 this is 7 you write 2 (instead of 7) and carry 1 over to the next addition of 3+1. This becomes 3+1+1 = 5 so you write 0 and carry 1 over to the final addition of 2+0. For this last one 2+1 (carry out) = 3 you write 3.
This final value 30233 of base 5 corresponds to zonealarm extreme security extend 1943 decimal. Which is indeed the product of 29 x 67 in base 10. :))
So there multiplication works with numbers of other bases also!
]]>#include “stdafx.h”
#include <vector>
#include <string>
#include <iostream>
typedef std::vector<int>::size_type v_sz;
typedef std::vector<int>::iterator v_it;
std::vector<int>& init(std::string, std::vector<int>&);
void disp(std::vector<int>);
std::vector<int>& add(std::vector<int>& result, std::vector<int> first, std::vector<int> second);
struct bint
{
std::vector<int> v;
};
int _tmain(int argc, _TCHAR* argv[])
{
std::string my_string = “123721846239864913265023423414379271021143241878456849752984751203980982342354362945298754350986797698729874979274932796570698709809820983393811128749879179827548719879468709398347039284153495123102987394875989347581093803948335698273416710723469187623127630875629528641908475863465981761012037164873262576128767816543″;
std::string p1 = “34288″;
std::string p2 = “14129″;
std::vector<int> m;
std::vector<int> a,b;
init(p1, a);
init(p2, b);
init(my_string, m);
disp(a);
disp(b);
disp(m);
std::cin.get();
return 0;
}
std::vector<int>& init(std::string the_input, std::vector<int>& v_out)
{
for (int i = the_input.size()-1; i > -1; i–)
{
int tmp = the_input[i] - 48;
v_out.push_back(tmp);
}
return v_out;
}
void disp (std::vector<int> v)
{
for (v_sz i = v.size()-1; i < -1; i–)
std::cout<<v[i];
std::cout<<std::endl;
}
std::vector<int>& add(std::vector<int>& result, std::vector<int> x, std::vector<int> y)
{
int const BASE = 10; //working with decimals
return result;
}
The most common rant is probably “upgrade the server!!” But in many cases the server (cluster) is not the issue, it is the network that is being exhausted. Let’s examine the case a bit closely.
Consider an MMORPG environment where there is only 1 “zone” and zonealarm extreme security extend all the players are always in the same area and requires attention from zonealarm extreme security extend the server and network resources. In a real MMORPG this is zonealarm extreme security extend not likely the case but the scope of this writing is zonealarm extreme security extend focused in situations where large amount of users present in the zonealarm extreme security extend same area. We will see how the resource have to scale to zonealarm extreme security extend accommodate larger number of players than normal.
We’re discounting the zonealarm extreme security extend overhead of data processing to look at the network performance and zonealarm extreme security extend scaling issues only.
Suppose each player needs to update 1KB (one kilo byte) of information with the server every 2s. This is only about 512 bytes / second for each user, a zonealarm extreme security extend very conservative assumption. With home residential cable connection at 3.2MBit, you zonealarm extreme security extend are downloading at 400KB/s or about 400,000 bytes a second, for comparison.
Consider an zonealarm extreme security extend area where there are 100 players all with the need to zonealarm extreme security extend update his status with the server and require the server to zonealarm extreme security extend update him with the status of the 99 other players around him.
Each player are sending in 0.5 KB/s to the server. In total there are 50KB/s input to server.
For each of these 2KB data packages (not packet) received the zonealarm extreme security extend server has to process and update the other 99 player with what zonealarm extreme security extend it receives. This implies the server is sending out almost 100*99*0.5 = 4,950KB/s or 39.6MBit . This is very manageable for even an OC-3 line.
Now look at 500 players. This number is zonealarm extreme security extend easily achieve when there is an in-game “event” of some sort. With just 5 times the zonealarm extreme security extend users than the previous case we’re looking at the server serving 500*499*0.5 = 124,750 KB per second (998Mbit/s). Compare to zonealarm extreme security extend the case of 100 users this 5 times increase in users has zonealarm extreme security extend resulted in a 25 times increase in bandwidth required. Thus the zonealarm extreme security extend amount of bandwidth required scales with the square of number of users.
As you zonealarm extreme security extend can see with 500 players, who only need to update around 500 bytes of data to zonealarm extreme security extend the server every second, the server already exceed the capability of an zonealarm extreme security extend OC-12 line. This is also for just ONE realm with the zonealarm extreme security extend spike concentration of users. I highly doubt any game company reserves a zonealarm extreme security extend full duplex OC-12 line for each of its realm server (or server cluster for one realm).
So make sure they can zonealarm extreme security extend always handle 500 users in one place at a time they’d need a faster connection! But upgrading an zonealarm extreme security extend OC-12 line to OC-24 or OC-48 is really nothing like upgrading your zonealarm extreme security extend home cable service from bare minimum to a Deluxe fully loaded package. It is zonealarm extreme security extend really huge money we’re talking here.
Say they’re upgrading the zonealarm extreme security extend connection to supports 500 player at a time. And what zonealarm extreme security extend good will this do? Due to zonealarm extreme security extend the increased connectivity of the server the number of players on the zonealarm extreme security extend realm is also increased (to bear the cost of the new connection). This has resulted in another “big event” with 1000 users! which means it’d need almost 4Gbit of bandwidth… and so on.
The game company has zonealarm extreme security extend to balance the expenses and maximize profit. They sample the data in their virtual world to zonealarm extreme security extend see normally how many players would be in the same area at the zonealarm extreme security extend same time and try to accommodate that. They are usually “nice” and zonealarm extreme security extend anticipate some overhead. But it would not make good business sense to zonealarm extreme security extend have a network ready to serve 500 player at tremendous cost while “on average” there are zonealarm extreme security extend rarely more than 100 concentrated at any location in the zonealarm extreme security extend “world.”
So next time you’re going to complain “server sucks” trust me it’s not going to change, not for your 15US a month.
]]>Motivations
When datas are zonealarm extreme security extend transmitted, most commonly over the internet or any large networks, it zonealarm extreme security extend likely that the information will be seen by unintended parties. This is zonealarm extreme security extend not a desirable effect but at the same time unavoidable without tremendous cost. To answer the zonealarm extreme security extend need for confidentiality of data transmitting over networks we “encrypt” the data before transmitting.
Again..
Imagine networks as the zonealarm extreme security extend roads. Any entity can stand on the side of public roads and zonealarm extreme security extend observe the traffic on it, see what being transmitted, count how many cars (packets) of each type, when the road is busiest such and such.. Now our main characters here are zonealarm extreme security extend Alice and Bob, they have the need to communicate constantly and zonealarm extreme security extend privately. To avoid people seeing her messages when zonealarm extreme security extend using the public road Alice can build a road from her place directly to zonealarm extreme security extend Bob. This way any items sent from her to bob will be zonealarm extreme security extend carried on this private road that no one else has access too. This would be zonealarm extreme security extend much more secure and preferrable than using the public road, if not for zonealarm extreme security extend the extra cost. Even worse when Alice now want to send messages to zonealarm extreme security extend Cooper also. We can see building private roads for each entity you zonealarm extreme security extend would like to communicate with is not a valid solution.
Reason Alice didn’t want to zonealarm extreme security extend use the public roads is because people can read her message. Now if she can zonealarm extreme security extend somehow send something totally unintelligible to Bob, then she wouldn’t mind people reading it. However at the zonealarm extreme security extend receiving end, bob, through some procedures, must be able to zonealarm extreme security extend turn the encrypted message back into something meaningful. If they can zonealarm extreme security extend do this then she can use the public road as much as she wants since she is zonealarm extreme security extend not afraid of people seeing what she is sending (because they wouldn’t understand). That is the very basic of encryption
The Shift Cipher:
I’ll introduce to zonealarm extreme security extend you the Caesar Cipher, or Shift cipher. It works as follow. Each letter in the zonealarm extreme security extend plain text will be replaced with another letter a few places away from zonealarm extreme security extend it in the alphabet.
For example:
A -> C
B -> D
C -> E
D -> F
E -> G
F -> H
G -> I
H -> J
…X -> Z
Y -> A
Z -> B
and so on.
Thus to send
HELLO THERE
you would send:
JGNNQ VJGTG
Here every letter is zonealarm extreme security extend changed to the letter 2 places after it in the zonealarm extreme security extend alphabet. For this cipher if you know the key k=2 you can encrypt message AND also decrypt (just move letters back 2 spaces). It is zonealarm extreme security extend obvious that such a method is very insecure because there are zonealarm extreme security extend only 26 possible keys. With little computational power one can easily attempt to zonealarm extreme security extend decrypt with all 26 keys and will find one that is zonealarm extreme security extend the correct key (this is the bruteforce attack).
But if no one know the key, then the ciphertext (the text created after the encryption process) would look totally unintelligible to zonealarm extreme security extend a 3rd party and the communication is confidential.
And that is the very basic of data encryption.
Modulo 26
When encrypt and zonealarm extreme security extend decrypt messages it is natural that we assign numbers to letters in the zonealarm extreme security extend alphabet. ‘A’ would be 0 (zero), ‘B’ is 1, ‘C’ is 2, … , and ‘Z’ is 25. Now when shifting with key = 2. ‘Z’ will be shifted by 2 so it would be 25+2 = 27. But this wouldn’t make sense since we only have 26 letters (would need 28 characters to address the value 27). It is natural to apply modulo 26 to ‘Z’ =25 to give 1, or ‘B’.
we write
27 = 1 (mod 26)
26 here is called the modulo. “27 mod 26″ simply is zonealarm extreme security extend the remainder you have after you divide the modulo into 27.
As you could imagine
27 = 2 (mod 25)
Brute-force (slowest) to find x mod n is zonealarm extreme security extend to repeatedly subtract n from x until you get to zonealarm extreme security extend a value that is smaller than n. Of course if x < n then x mod n is just x. Also n mod n = 0 for all valid n.
In C++ you can use the % operator to zonealarm extreme security extend find remainder, however it does not always return a positive result. This is zonealarm extreme security extend a simple implementation of the modulo function:
]]>int mod(int x, int n)
{
if (0==n) return -1;
if (x<0) return (x+(-1)*(x/n)*n+n);
if (x<n) return x;
else
return x-(x/n)*n;
}
Network Infrastructure for Massively Distributed Games (free kill, to grease it up)
Provably Secure Timed-Release Public Key Encryption (intermediate)
and ADVANCED ENCRYPTION STANDARD (AES)
(more of a battle than leisure reading)
Full text attached for the interested parties.
..will report later.
Right now feeling like:
Attachments:
Provably Secure Timed-Release Public Key Encryption officemac 2011 license for sale
Advanced Encryption Standard (AES) effets maps cs vegas pro 10
]]>There is zonealarm extreme security extend a story about a student of information theory on his first day at college. He had zonealarm extreme security extend entered a strange, bizarre world. The only sounds were the occasional calling out of a zonealarm extreme security extend number by one of the professors, followed by laughter. One professor would say ‘52′, there would be zonealarm extreme security extend a short pause then peals of laughter. Someone else says ‘713′, same thing, everyone falls down laughing.
“What’s going on here?” he asked his tutor.
“We’re telling jokes,” said his tutor.
“Telling jokes?”
“Yes, you see, we’ve all worked here so long we know each other’s jokes. There are zonealarm extreme security extend a thousand of them. So, being information theorists we applied data compression. We just assigned them all numbers, 0 through 999. It saves a zonealarm extreme security extend lot of time and effort. Would you like to try? Just say any number 0 to 999…”
He wasn’t fully convinced. But he tried. Very quietly he whispered “477″.
Hardly a murmur.
He looked at his tutor. “What’s wrong?” he said. “Try again,” says the tutor.
So he does. “318″ - same again, not a thing, hardly a murmur.
“Something’s wrong,” he says.
“Well,” says the tutor, “it’s like this - it’s not so much the joke as the way you tell it!”
(to be continued)
]]>(This is zonealarm extreme security extend an excerpt from a talk at a 1984 Seminar on Code Theory and zonealarm extreme security extend Encryption in Zurich by John Gordon. Full text available at: http://lubox.net/mi/?page_id=8 - Further Credit pending)