Kamis, 30 Mei 2013

Shuffling Card also use algorithm?

Anyone know what algorithm use on it.
Nah, this is it..check it out ..it can be use for every single card also..

  1. Card games have been mankind's favorite passtimelong before the era of computers. Many, perhaps most, popular card games have been programmed into computer software.

Every card game I have ever seen starts by shuffling the cards. The purpose of the shuffling is to rearrange the cards in a more-or-less random order.
  • Surprisingly, despite the popularity of card games among computer users, just about any programming textbook teaches several algorithms on how to sort a pack of cards but most offer no clue on how to shuffle it.

In this node I will present my own card-shuffling algorithm. I also hope others will present other card-shuffling algorithms.

Preliminaries

First of all, to use my algorithm we need to represent the cards as an integer array of size n, where n is the total number of cards.
For example, a typical solitaire game uses one deck of cards consisting of four suits each containing 13 cards (from ace to king). In this case, n is equal to 4 times 13, or 52.
A different game can use two decks, plus four jokers, for an n of 108, etc.
Whatever the size of n, we will have n cards which we will refer to as card[0] ... card[n-1]. Each card has a unique value in the [0...n-1] range.
It is quite simple to convert the integer value of a card into its suit and face value. For example, with n = 52 we have four suits (0...3), so any card[i] is inside the suit card[i] / 13, while its face value iscard[i] MOD 13, where MOD designates modulo division.

The Algorithm

Step 1: Initialize the cards. For each i in the [0...n-1] range, set card[i] = i.
Step 2 (optional): Seed the random number generator.
Step 3: Let i = 0.
Step 4: Let j = random_number MOD n.
Step 5: Exchange the values of card[i] and card[j].
Step 6: Let i = i + 1. If i is less than n, go to step 4.

Sample Source Code

Here is a sample C function implementing the algorithm:
void shuffle(int *card, int n) {
 int i, j, k;

 for (i = 0; i < n; i++)
  card[i] = i;

 for (i = 0; i < n; i++) {
  j = rand() % n;
  k = card[i];
  card[i] = card[j];
  card[j] = k;
 }
}


Well, that's it..try to prove it yourself too..
:)
Enjoy ..HAND :D

Jumat, 26 April 2013

Anyone ever peek, the Model of Sensational-Cryptography?

Haii..back again with the new topic...
the topic is ... .... .... ...
No', exactly that's not sensational, but the model of conventional Cryptograpy..
yuppp, take a look at 'her';;)

 A source produces a message in plaintext, X = [ X 1 , X 2 , ..., X M ]. The M elements of X are letters in some finite alphabet. Traditionally, the alphabet usually consisted of the 26 capital letters . Nowadays, the binary alphabet {0, 1} is typically used. For encryption, a key of the form K = [ K 1 , K 2 , ..., K J ] is generated. If the key is generated at the message source, then it must also be provided to the destination by means of some secure channel. Alternatively, a third party could generate the key and securely deliver it to both source and destination. 


With the message X and the encryption key K as input, the encryption algorithm forms the ciphertext Y = [ Y 1 , Y 2 , ..., Y N ]. We can write this as
Y = E( K , X )

This notation indicates that Y is produced by using encryption algorithm E as a function of the plaintext X , with the specific function determined by the value of the key K .
The intended receiver, in possession of the key, is able to invert the transformation:
X = D( K , Y )
An opponent, observing Y but not having access to K or X , may attempt to recover X or K or both X and K . It is assumed that the opponent knows the encryption (E) and decryption (D) algorithms. If the opponent is interested in only this particular message, then the focus of the effort is to recover X by generating a plaintext estimate . Often, however, the opponent is interested in being able to read future messages as well, in which case an attempt is made to recover K by generating an estimate .

Cryptography

Cryptographic systems are characterized along three independent dimensions:
  1. The type of operations used for transforming plaintext to ciphertext. All encryption algorithms are based on two general principles: substitution, in which each element in the plaintext (bit, letter, group of bits or letters) is mapped into another element, and transposition, in which elements in the plaintext are rearranged. The fundamental requirement is that no information be lost (that is, that all operations are reversible). Most systems, referred to as product systems , involve multiple stages of substitutions and transpositions.
  2. The number of keys used. If both sender and receiver use the same key, the system is referred to as symmetric, single-key, secret-key, or conventional encryption. If the sender and receiver use different keys, the system is referred to as asymmetric, two-key, or public-key encryption.
  3. The way in which the plaintext is processed . A block cipher processes the input one block of elements at a time, producing an output block for each input block. A stream cipher processes the input elements continuously, producing output one element at a time, as it goes along.

well, that's it ..

Enjoy it ::)

HAND ;;)

Jacques Mesrine, The French's "James Bond"

Well, anyone outside there, know this guy, "Jacques Mesrine"?
He is French "James Bond" .....i mean, the bad "James Bond".. wanna to know why?
Here is the story of the "Bad French's James Bond"....

                                                    He is cute, isn't he ?but ....
                                                            He is not my type ..i mean friend ...
Jacques Mesrine ..
was one of the most infamous criminals in modern French history. He was responsible for numerous murders, bank robberies, burglaries, and kidnappings in France and Canada. Mesrine repeatedly escaped from prison and made international headlines during a final period as a fugitive when his exploits included trying to kidnap a judge who had sentenced him. An aptitude for disguise earned him the moniker "The Man of a thousand Faces" and enabled him to remain at large while receiving massive publicity as a wanted man. Mesrine was widely seen as an anti-establishment 'Robin Hood' figure. In keeping with his charismatic image, he was rarely without a glamorous female companion.

1936 - 1965 :
Jacques René Mesrine was born in Clichy-la-Garenne near Paris on 28 December 1936 to a couple of blue collar origin who had moved up in social class. As a child he witnessed a massacre of villagers by German soldiers. His parents had great aspirations for their son and sent him to the prestigious Catholic Collège de Juilly where his friends included the likes of musician and composer Jean-Jacques Debout. Mesrine was an extremely unruly pupil, and he was expelled from Collège de Juilly for attacking the principal. He went on to be expelled from other schools and fell into the lifestyle of a juvenile delinquent, much to the dismay of his family. In 1955 at age 19 he married Lydia De Souza in Clichy; the couple divorced a year later. Drafted into the French Army, he volunteered for special duty in the Algerian War as a parachutist/commando. While participating in ruthless counter-insurgency operations, Mesrine's duties are said to have included the killing of prisoners. Although he disliked military discipline, Mesrine enjoyed action and was decorated with the Cross of Military Valour by General Charles de Gaulle before leaving the army in 1959. His father was later to claim that the time in Algeria had brought about a noticeable deterioration in Mesrine's behavior.


In 1961 Mesrine became involved with the Organisation de l'armée secrète. He married Maria De La Soledad; they had three children but later separated in 1965. In 1962 Mesrine was sentenced to 18 months in prison for robbery (his first prison sentence although he had been a professional criminal for a number of years). After being released Mesrine made an effort to reform: he worked at an architectural design company where he constructed models, showing considerable ability. However a downsizing in 1964 resulted in him being made redundant. His family bought him the tenancy of a country restaurant, a role in which he was quite successful, but this arrangement ended after the owner paid a visit one evening to find Mesrine carousing with acquaintances from his past. The lure of easy money and women proved impossible for him to resist and he returned to crime. Overcoming some suspicion about his relatively middle-class background, Mesrine began to establish a reputation in the underworld as a man who was crossed at one's peril.
In December 1965, Mesrine was arrested in the villa of the military governor in Palma de Mallorca. He was sentenced to six months in jail and later claimed that Spanish authorities believed he was working for French intelligence
1966–1972
In 1966, Mesrine opened a restaurant in the Canary Islands. In December of the same year he robbed a jewellery store in Geneva and a hotel in Chamonix. The following year, Mesrine robbed a fashion store in Paris. In February 1968, he fled to Québec with his then mistress Jeanne Schneider and worked as a cook and chauffeur for grocery and textile millionaire Georges Deslauriers for a few months before an argument Schneider had with Deslauriers' long-time respected gardener led to them being dismissed. They then attempted to kidnap Deslauriers, but it went wrong due to the fact that the 'knock out drops' they used were inert, and on June 26, 1969, Mesrine and Schneider fled to the US. On June 30 Evelyne Le Bouthillier, an elderly lady who may have given them refuge, was found strangled. A couple of weeks later, on July 16, Mesrine and Schneider were arrested in Arkansas on information supplied by an accomplice and extradited back to Québec.

Mesrine was sentenced to ten years in prison for the bungled kidnapping but escaped a few weeks later, only to be reapprehended the next day. Mesrine and Schneider were acquitted of the murder of Le Bouthillier in 1971. With Jean-Paul Mercier, Mesrine cut through the wire to escape again on August 21, 1972 with five others from the Saint-Vincent-de-Paul prison. Mercier, a wanted murderer, and Mesrine then robbed a series of banks in Montreal, sometimes two in the same day. It was at this time that it became apparent that Mesrine did not have a normal criminal orientation towards minimizing the danger of being caught. Deeply resenting the way he had been treated in the prison, Mesrine and Mercier made an extremely risky attempt to precipitate a mass break out from the maximum security block of Saint-Vincent-de-Paul on September 3, 1972. However, their own break-out had caused perimeter security to be greatly increased and they found the area swarming with armed guards. There was a shoot-out in which two guards were seriously injured and Mercier was wounded before they managed to get away. The effrontery of escaped convicts returning to attack a prison infuriated Canadian law enforcement; the escapade predictably led to a hugely increased effort to apprehend the duo.[4]

Murder of Médéric Cote and Ernest Saint-Pierre

A week after their foiled attempt to free the prisoners, Mesrine and Mercier went for a target practice session, taking Mercier's girlfriend along. But the location, though three miles down a dirt track through the forest, was far from being truly remote and the noise of them blasting away at targets all afternoon could be heard in Plessisville where there was a Ministry of Natural Resources and Wildlife station. When Mesrine and company drove back along the track, two forest rangers, Médéric Cote, aged 62, and Ernest Saint-Pierre, aged 50, were waiting. The rangers were armed but their jobs had mainly involved enforcing hunting and firearms regulations, and in any case there was no reason for them to expect that the men who had been making themselves conspicuous by such a disturbance would actually be wanted escapees. Realizing they were not policemen, Mesrine submitted to a search of the car, but on finding loaded guns in the rear, the rangers informed them that they would have to follow their car back to Plessisville. While Mesrine was trying to talk them out of this, Cote, possibly alerted by the sight of the arsenal of weapons, suddenly recognised the pair, whereupon Mesrine and Mercier shot both officers dead.



Mesrine continued robbing banks in Montreal, and even covertly gained access into the US again for a brief stay at the Waldorf Astoria Hotel in New York City, before moving to Caracas, Venezuela.

1972-1977

By the end of 1972 Mesrine had returned to France where he resumed robbing banks. On March 5, 1973, during an argument with a cashier in a coffee bar, Mesrine brandished a revolver and seriously injured a police officer who tried to intervene. He was arrested 3 days later. In May, he was sentenced to 20 years imprisonment – which, considering his record, was lenient for the time and place – to be served at La Santé maximum security prison where escape was thought to be impossible. In a plan likely formulated even before his arrest, Mesrine took a judge sentencing him on another matter hostage with a revolver (recovered from the courthouse lavatory where it had been hidden by an accomplice) and escaped. After being at large for four months, he was arrested in his new Paris apartment on September 28, 1973, on information supplied by an associate who wanted a reduced sentence. Mesrine was returned to La Santé where he covertly wrote and smuggled out an autobiography, titled L'Instinct de Mort ("Killer Instinct"), in which he claimed to have committed upwards of forty murders, (thought by some to be a considerable exaggeration). The publication of Mesrine's book resulted in France passing a "Son of Sam law", a law designed to keep criminals from profiting off the publicity of their crimes.

Escape from La Santé

La Santé was seen as escape proof. In his escapes from his Canadian prisons, Mesrine had required little more than wire cutters and a very high degree of audacity, now he faced security far better than any he had defeated before. A report noted that Mesrine had been seen doing exercises in his cell and was behaving like a man who had received good news. On May 8, 1978, he produced a gun, stole keys, and, with François Besse (a highly accomplished escaper in his own right), and another man, Mesrine got out of a cellblock and into a fenced-off yard walkway. They had a grappling iron with them and Mesrine forced some workmen with an extending ladder to bring the ladder along. The trio unlocked a yard gate in an inner wall; an armed guard was taken by surprise at his post. The men then reached an isolated part of the 14 metre (46 ft) high exterior wall (which would have presented a considerable challenge without the ladder). They hooked the grappling iron onto the top of the ladder and slid down the rope. The third man over the wall was shot dead by police in the street outside. Mesrine and Besse hijacked a car and evaded the police cordon; they had become the first men to escape from La Santé.

Mesrine as fugitive

Mesrine and Besse robbed a Paris gunsmith four days after their escape from La Santé. On May 26, 1978, the duo robbed the Deauville Casino of 130,000 francs, but the police arrived as they exited. Around 50 shots were exchanged and Mesrine was wounded, but the duo made a getaway. Mesrine and Besse eluded the subsequent massive sweep of the area by taking a farmer and his family hostage and forcing him to drive them to safety. Subsequently, the kidnapping of a banker netted them 450,000 francs in ransom. Despite his position as "French Public Enemy Number One" (L'Ennemi Public Numéro Un), Mesrine was featured on the cover of the 4th August 1978 Paris Match. In an interview inside he threatened the Minister of Justice. By remaining at large in the Paris area, despite his notoriety, Mesrine appeared to be making a fool of the law and the state; the Paris Match interview was the last straw. The police agencies hunting Mesrine were pressured for results from the highest echelons of government.

This proved to be difficult, not least because of rivalry between the various agencies. The usual informants were of little use as Mesrine generally avoided contact with the criminal underworld. Moreover, he was adept at disguising his appearance and allaying suspicion from members of the public: he reportedly went for a drink with his neighbours and laughed when one said he "looked like Mesrine". Mesrine travelled to Sicily, Algeria, London, and Brussels, and back to Paris in November 1978, where he again robbed a bank. Objecting to Mesrine's proposed kidnapping of a senior judge, and not sharing his desire for revenge against the system, François Besse disassociated himself from Mesrine and later disappeared. Besse was finally captured in 1994; he was paroled in 2006.

Public Enemy No. 1

Mesrine's next exploit occurred in November 1978. It was a daring attempt to kidnap a judge (who had sentenced him) as part of a campaign to get maximum security prisons closed. His accomplice was captured but Mesrine escaped by running downstairs past several policemen telling them "Quick! Mesrine's up there!" A young policeman posted outside was found handcuffed to a drainpipe weeping. On June 21, 1979, Mesrine kidnapped millionaire real estate mogul Henri Lelièvre and received a ransom of six million francs.
Mesrine made good copy for the press, clowning for the camera and asserting that his criminal activity was politically motivated.

Jacques Tillier (a former Directorate of Territorial Security policeman) had written disparagingly about Mesrine in the French newspaper Minute but on September 10, 1979 he went, rather incautiously, to a clandestine meeting with Mesrine on the promise of an interview. The incensed Mesrine had other plans: he shot Tillier in the face, leg and arm. However, during his contact with Mesrine, Tillier had discovered the identity of Mesrine's accomplice.

Death

The special gendarme unit tasked with finding and capturing Mesrine found it impossible to track him down directly. Eventually, by utilizing information supplied by Tillier, they ascertained the licence number of the car that a female named Sylvia Jeanjacquot, believed to be Mesrine's mistress, had used and checked parking tickets which it had received months previously. These tickets indicated that she had been frequenting a certain district without any obvious cause. Undercover patrols combed the area and a man fitting Mesrine's description was spotted walking with a woman believed to be Jeanjacquot on October 31, 1979. One officer who had seen Mesrine at court confirmed the identification by noting Mesrine's distinctive build. The couple were followed home and their building watched around the clock.



Three days later, on November 2, 1979, the couple left the apartment for a weekend in the country, taking Jeanjacquot's pet poodle with them. Mesrine and Jeanjacquot had reached Porte de Clignancourt on the outskirts of Paris when the gold BMW they were driving was boxed in at the entrance to an intersection and police marksmen in the rear of a lorry immediately in front of their car threw open a tarpaulin. Reportedly, in the instant before the gendarmerie opened fire Mesrine's eyes were described as being so shocked they seemed to be bursting from his head as he realized he was trapped. Twenty rounds were fired at point blank range; Mesrine was hit 15 times. A coup de grâce was then administered with a pistol. Sylvia Jeanjacquot lost one eye and suffered lasting damage to her arm. Her pet dog was killed.

Aftermath

French police announced that their operation was a success and received congratulations from then President Valéry Giscard d'Estaing. There were suggestions in some media publications that Mesrine may have been shot without warning in a way which amounted to extrajudicial killing, but the police pointed out that he had sworn that he would never surrender and that, as well as having a gun on him, Mesrine had been armed with two grenades which were taped together and adapted so they could be brought into action instantly.
Sylvia Jeanjacquot was not charged with any crime. Mesrine's former defense attorney, Maître Malinbaum, continued for 30 years to fight for a judicial investigation into the events surrounding Mesrine's death at Porte de Clignancourt and to have the French state held accountable for what she saw as the assassination of her client.

Murder of Gérard Lebovici

By law Mesrine could not profit from L'instinct de Mort but the publishers had received a threatening letter from him in 1979 demanding payment nonetheless. L'instinct de Mort was republished in 1984 by Champ Libre Editions, The founder of Champ Libre, Gérard Lebovici, was a gifted entrepreneur, influential in the French film industry, and known for his fascination with criminals. Lebovici adopted Mesrine's daughter after her father's death.
On March 5, 1984, the body of Gérard Lebovici was found in the Avenue Foch underground car park. He had been shot dead, with the bullet wounds forming a square: a traditional underworld sign for a contract that has not been fulfilled. One theory is that Lebovici may have been killed by a close associate of Mesrine's who Lebovici may have had an appointment with on the day of his death.


That's all the story of the French's James Bond..
Thank you :)

Selasa, 02 April 2013

Internet Standard Document: X800 vs RFC 2828

Hi there.. This is my first time, i post something in my blog..
Well, actually that, this is my College homework.. Even, honestly, really confused about this homework.. @.@

First of all, i am going to write about "Internet Standard":

In computer network engineering, an Internet Standard (abbreviated as "STD") is a normative specification of a technology or methodology applicable to the Internet. Internet Standards are created and published by the Internet Engineering Task Force (IETF).

An Internet Standard is characterized by a high degree of technical maturity and by a generally held belief that the specified protocol or service provides significant benefit to the Internet community. Generally Internet Standards cover interoperability of systems on the Internet through defining protocols, message formats, schemas, and languages. The most fundamental of the Internet Standards are the ones defining the Internet Protocol.

An Internet Standard ensures that hardware and software produced by different vendors can work together. Having a standard makes it much easier to develop software and hardware that link different networks because software and hardware can be developed one layer at a time. Normally, the standards used in data communication are called protocols.

Next, i am going to write about the "Standard Documents And Series" .. In here, there are 2 series what i am going to write ..
The First one is ITU-T: X Series ====> "X.800"
and, the second one is RFC ====> "RFC 2828"


1. X.800
X.800 defines the general security-related architectural elements which can be applied appropriately in the circumstances for which protection of communication between open systems is required. It establishes, within the framework of the Reference Model (Read:"X.200"), guidelines and constraints to improve existing Recommendations (Read:"X.800") or to develop new Recommendations in the context of OSI in order to allow secure communications and thus provide a consistent-approach to security in OSI.

This Recommendation:
a. Provides a general description of security services and related mechanisms, which may be provided by the Reference Model; and
b. Defines the positions within the Reference Model where the services and mechanims may be provided.

So,
This Recommendation extends the field of application of Recommendation X.200, to cover secure communications between open systems.


2. RFC 2828
a Request for Comments (RFC) is a memorandum published by the Internet Engineering Task Force (IETF) describing methods, behaviors, research, or innovations applicable to the working of the Internet and Internet-connected systems.

RFC 2828 defines the security service is a processing or communication service that is provided by a system to give a specific kind of protection to system resources; security services implement security policies and are implemented by security mechanisms.

Each RFC is static; if the document is changed, it is submitted again and assigned a new RFC number. If an RFC becomes an Internet Standard (STD), it is assigned an STD number but retains its RFC number. When an Internet Standard is updated, its number stays the same and it simply refers to a different RFC or set of RFCs. A given Internet Standard, STD n, may be RFCs x and y at a given time, but later the same standard may be updated to be RFC z instead.

 For example, in 2007 RFC 3007 was an Internet Standard—STD 1—and in May 2008 it was replaced with RFC 5000, so RFC 3700 changed to Historic status, and now STD 1 is RFC 5000. When STD 1 is updated again, it will simply refer to a newer RFC, but it will still be STD 1. Note that not all RFCs are standards-track documents, but all Internet Standards and other standards-track documents are RFCs.


I think, that's all for today.. i will write about it again whenever i have any information about it again.
Sorry, if my writing is a bit mess, because this is my first time write something into my blog..
Thank you :)