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 vegas pro oem 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 vegas pro oem password which has been encrypted with the salt, which is also in the vegas pro oem 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 vegas pro oem 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 vegas pro oem same words will encrypt to the same ciphertext. This means on a vegas pro oem system with very large amount of user there will be a vegas pro oem 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 vegas pro oem mostly unique to each user. It is often the encryption of the vegas pro oem time the user is added to the system (thus relatively unique for each user). This salt is vegas pro oem mixed with the user password before we start the encryption. This means for vegas pro oem any given two users it is extremely unlikely that they are vegas pro oem BOTH added to the system at the same time and use the vegas pro oem same password.
Simply put, salts allow the vegas pro oem 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 vegas pro oem -lcrypt option at the end. This will tell the compiler that vegas pro oem you are using crypt function.
The above program when run will yield output:
$1$TMVRB39B$PUaDAsZctLWtj0kteqvBe1
with the vegas pro oem 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 vegas pro oem computer lab to demonstrate your program. I will grade and vegas pro oem return Thursday so you can review for your test.
Thursday April 3rd: Last class before your vegas pro oem 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 vegas pro oem an in-class assignment on this day so make sure you vegas pro oem don’t miss class. This assignment is vegas pro oem 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 vegas pro oem put his cell phone on the internet, did you?
]]>For Mathematic major, after you vegas pro oem take all your Calculus and basic linear algebra you’d advance to vegas pro oem Advanced Calculus. Advanced Calculus is quite a big leap from the vegas pro oem “normal” mathematics you’ve been studying so far. Now you’re not learning mathematics to vegas pro oem 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 vegas pro oem will learn about series and sequences and their properties and more. You’d be exposed to thinking very very fine (small) and vegas pro oem also accept values and concepts that is larger than the vegas pro oem largest thing you know so far.
It’s a vegas pro oem big leap in understanding and requires a mature mind capable of abstract thinking. After you vegas pro oem master the basics of sequences, convergence… of Advanced Calculus you’d be vegas pro oem ready for the next step that is beginning Analysis. Intro to vegas pro oem Analysis is a course designed to bridge the gap from vegas pro oem 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 vegas pro oem quite straightforward to some people while does not seem “logical.” Your common sense may work for vegas pro oem 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 vegas pro oem a guest in it. Now a new guest arrive.
None of the vegas pro oem guests at the hotel will share a room with anyone. And no vegas pro oem 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 vegas pro oem hotel is filled then we can say the hotel is vegas pro oem full! Meaning no more guests can be accommodated? Well but that’s the vegas pro oem logic for a normal hotel, this is Hotel Infinity where we have vegas pro oem infinitely many rooms remember? Having all the rooms filled and “NO VACANCY” is two very different thing here.
To accept this vegas pro oem solution you must first accept that Hotel Infinity has infinitely many rooms. This IS the vegas pro oem 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 vegas pro oem new guest, you would tell the guest in room1 to move to vegas pro oem room 2. Guest in room 2 move to room 3, room 3 move to vegas pro oem room 4 and so on. You tell guest in room n to move to room number n+1 and vegas pro oem son on. Because you have infinitely many rooms there will always be vegas pro oem a room for everyone to move in to. By doing this vegas pro oem you have just freed up room 1! Now just send the new guest to this room
Yes you vegas pro oem just check a guest into a hotel where all the rooms are vegas pro oem filled! Let your imagination roams
The problem is extended when Continue’Em Tours send there entire fleet of buses to vegas pro oem 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 vegas pro oem 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 vegas pro oem question. The reason is being you are working with decimals (base of 10). Meaning the vegas pro oem digit 1 space to the left of the least significant bit (LSB) means how many 10s the vegas pro oem value has. The digit 2 spaces to the left of the vegas pro oem 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 vegas pro oem it that this representation of 1291 decimal in base 5 is vegas pro oem unique (it is). Now our question would be vegas pro oem if the multiplication method we learned from 5th grade still work on number of a vegas pro oem 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 vegas pro oem something larger than 10 (or the base) we do a carry out (or “save” or “remember”)? It is vegas pro oem the same thing here. But instead of 10, everytime you have vegas pro oem something larger than 5 you have to carry out 1 for vegas pro oem 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 vegas pro oem final step of adding the 3 values together. When you vegas pro oem 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 vegas pro oem 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 vegas pro oem all the players are always in the same area and requires attention from vegas pro oem the server and network resources. In a real MMORPG this is vegas pro oem not likely the case but the scope of this writing is vegas pro oem focused in situations where large amount of users present in the vegas pro oem same area. We will see how the resource have to scale to vegas pro oem accommodate larger number of players than normal.
We’re discounting the vegas pro oem overhead of data processing to look at the network performance and vegas pro oem 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 vegas pro oem very conservative assumption. With home residential cable connection at 3.2MBit, you vegas pro oem are downloading at 400KB/s or about 400,000 bytes a second, for comparison.
Consider an vegas pro oem area where there are 100 players all with the need to vegas pro oem update his status with the server and require the server to vegas pro oem 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 vegas pro oem server has to process and update the other 99 player with what vegas pro oem 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 vegas pro oem easily achieve when there is an in-game “event” of some sort. With just 5 times the vegas pro oem 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 vegas pro oem the case of 100 users this 5 times increase in users has vegas pro oem resulted in a 25 times increase in bandwidth required. Thus the vegas pro oem amount of bandwidth required scales with the square of number of users.
As you vegas pro oem can see with 500 players, who only need to update around 500 bytes of data to vegas pro oem the server every second, the server already exceed the capability of an vegas pro oem OC-12 line. This is also for just ONE realm with the vegas pro oem spike concentration of users. I highly doubt any game company reserves a vegas pro oem full duplex OC-12 line for each of its realm server (or server cluster for one realm).
So make sure they can vegas pro oem always handle 500 users in one place at a time they’d need a faster connection! But upgrading an vegas pro oem OC-12 line to OC-24 or OC-48 is really nothing like upgrading your vegas pro oem home cable service from bare minimum to a Deluxe fully loaded package. It is vegas pro oem really huge money we’re talking here.
Say they’re upgrading the vegas pro oem connection to supports 500 player at a time. And what vegas pro oem good will this do? Due to vegas pro oem the increased connectivity of the server the number of players on the vegas pro oem 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 vegas pro oem to balance the expenses and maximize profit. They sample the data in their virtual world to vegas pro oem see normally how many players would be in the same area at the vegas pro oem same time and try to accommodate that. They are usually “nice” and vegas pro oem anticipate some overhead. But it would not make good business sense to vegas pro oem have a network ready to serve 500 player at tremendous cost while “on average” there are vegas pro oem rarely more than 100 concentrated at any location in the vegas pro oem “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 vegas pro oem transmitted, most commonly over the internet or any large networks, it vegas pro oem likely that the information will be seen by unintended parties. This is vegas pro oem not a desirable effect but at the same time unavoidable without tremendous cost. To answer the vegas pro oem need for confidentiality of data transmitting over networks we “encrypt” the data before transmitting.
Again..
Imagine networks as the vegas pro oem roads. Any entity can stand on the side of public roads and vegas pro oem 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 vegas pro oem Alice and Bob, they have the need to communicate constantly and vegas pro oem privately. To avoid people seeing her messages when vegas pro oem using the public road Alice can build a road from her place directly to vegas pro oem Bob. This way any items sent from her to bob will be vegas pro oem carried on this private road that no one else has access too. This would be vegas pro oem much more secure and preferrable than using the public road, if not for vegas pro oem the extra cost. Even worse when Alice now want to send messages to vegas pro oem Cooper also. We can see building private roads for each entity you vegas pro oem would like to communicate with is not a valid solution.
Reason Alice didn’t want to vegas pro oem use the public roads is because people can read her message. Now if she can vegas pro oem somehow send something totally unintelligible to Bob, then she wouldn’t mind people reading it. However at the vegas pro oem receiving end, bob, through some procedures, must be able to vegas pro oem turn the encrypted message back into something meaningful. If they can vegas pro oem do this then she can use the public road as much as she wants since she is vegas pro oem 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 vegas pro oem you the Caesar Cipher, or Shift cipher. It works as follow. Each letter in the vegas pro oem plain text will be replaced with another letter a few places away from vegas pro oem 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 vegas pro oem changed to the letter 2 places after it in the vegas pro oem 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 vegas pro oem obvious that such a method is very insecure because there are vegas pro oem only 26 possible keys. With little computational power one can easily attempt to vegas pro oem decrypt with all 26 keys and will find one that is vegas pro oem 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 vegas pro oem a 3rd party and the communication is confidential.
And that is the very basic of data encryption.
Modulo 26
When encrypt and vegas pro oem decrypt messages it is natural that we assign numbers to letters in the vegas pro oem 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 vegas pro oem 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 vegas pro oem to repeatedly subtract n from x until you get to vegas pro oem 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 vegas pro oem find remainder, however it does not always return a positive result. This is vegas pro oem 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
]]>There is vegas pro oem a story about a student of information theory on his first day at college. He had vegas pro oem entered a strange, bizarre world. The only sounds were the occasional calling out of a vegas pro oem number by one of the professors, followed by laughter. One professor would say ‘52′, there would be vegas pro oem 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 vegas pro oem a thousand of them. So, being information theorists we applied data compression. We just assigned them all numbers, 0 through 999. It saves a vegas pro oem 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 vegas pro oem an excerpt from a talk at a 1984 Seminar on Code Theory and vegas pro oem Encryption in Zurich by John Gordon. Full text available at: http://lubox.net/mi/?page_id=8 purdue buy microsoft office - Further Credit pending)