📄 cipher.in
字号:
135CipherDescriptionThe Playfair cipher orPlayfair squareis a manual symmetric encryption technique and was the first literal digraphsubstitution cipherThe technique encrypts pairs of letters digraphs instead of single letters as in the simple substitution cipherand rather more complex Vigenere cipher systems then in useThe Playfair is thus significantly harder to breaksince the frequency analysisused for simple substitution ciphers does not work with itFrequency analysis can still be undertaken but on the all possible digraphsratherthan the twenty six possible monographsThe frequency analysis of digraphs is possiblebut considerably more difficultand it generally requires a much larger ciphertext in order to be usefulDespite its invention by Wheatstoneit became known as the Playfair cipher after Lord Playfairwho heavily promoted its useThe first recorded description of the Playfair cipher was in a documentsigned by Wheatstone on MarchIt was used for tactical purposesby British forces in the Second Boer War andin World War I and for the same purpose by the Australians and Germansduring World War IIThis was because Playfair is reasonablyfast to use and requires no special equipmentA typical scenario for Playfair usewould be to protect important but non critical secrets during actual combatBy the time the enemy cryptanalysts could break the messagethe information was useless to themHowever Playfair is no longer used by military forcesbecause of the advent of digital encryption devicesPlayfair is now regarded asinsecure for any purpose becausemodern handheld computers could easily break the cipher within secondsThe Playfair cipher uses a five by five table containing a keyword or phraseMemorization of the keywordand four simple ruleswas all that was required to create the five by five tableand use the cipherTo generate the key tableone would first fillin the spaces in the table withthe letters of the keyworddropping any duplicate lettersthen fill the remaining spaceswiththe rest of the letters of the alphabet in orderusually omitting Q to reduce the alphabet to fitThe key can be written in the top rows of the tablefrom left to rightor in some other patternsuch as a spiral beginning in the upperlefthand corner and ending in the centerThe keyword together withthe conventions for fillingin the five by five table constitute the cipher keyTo encrypt a messageone would change the lowercase to uppercasebreak the message into digraphs groups of two letters and throw away spacessuch thatfor exampleHello World becomes HE LL OW OR LDand map them out on the key tableThe two letters of the digraphlook like the corners of a rectangle in the key tableNote the relative position of the corners of this rectangleThen apply the following four rulesin orderto each pair of letters in the plaintextIf both letters are the sameor only one letter is leftadd an X after the first letterEncrypt the new pair and continueIf the letters appear on the same row of your tablereplace them with the letters to their immediate right respectivelywrapping around to the left side ofthe row if a letterin the original pair was on the right side of the rowIf the letters appear on the same column of your tablereplace themwith the letters immediatelybelow respectively wrapping aroundto the top side of the column if a letterin the original pair was on the bottom side ofthe columnIf the letters are not on the same row or columnreplace them with the letterson the same rowrespectively but at the other pair ofcorners of the rectangle defined by the original pairThe order is importantthe first encrypted letter of the pairis the one that lies on the same row as the first plaintext letterIf only one character in last group append a dummy character X at the endInputThe input consists of multiple test casesEach test case containing two lines the key and the messageOutputFor each test case print oneline containing the encrypted messagePlayfair overI am happy to join with you todayin what will go downin historyas the greatest demonstration for freedom in the history of our nationFive score years agoa great Americanin whose symbolic shadow we stand todaysigned the Emancipation ProclamationThis momentous decree came as a great beacon light of hopeto millions of Negro slaves who had been seared in the flames of withering injusticeIt came as a joyous daybreak to end the long night of their captivityBut one hundred years laterthe Negro still is not freeOne hundred years laterthe life of the Negro is still sadly crippled by the manacles of segregation and the chains of discriminationOne hundred years laterthe Negro lives on a lonely island of poverty in the midst of a vast ocean of material prosperityOne hundred years laterthe Negro is still languished in the corners of American society and finds himself an exile in his own landAnd so we have come here today to dramatize a shameful conditionIn a sense we have come to our nation capital to cash a checkWhen the architects of our republic wrote the magnificent words of the Constitutionand the Declaration of Independencethey were signing a promissory note to which every American was to fall heirThis note was a promise that all menyesblack men as well as white menwould be guaranteed the unalienable Rights of Life Liberty and the pursuit of HappinessIt is obvious today that America has defaulted on this promissory noteinsofar as her citizens of color are concernedInstead of honoring this sacred obligationAmerica has given the Negro people a bad checka check which has come back marked insufficient fundsBut we refuse to believe that the bank of justice is bankruptWe refuse to believe that there are insufficient funds in the great vaults of opportunity of this nationAnd sowe have come to cash this checka check that will give us upon demand the riches of freedom and the security of justiceWe have also come to this hallowed spot to remind America of the fierce urgency of NowThis is no time to engage in the luxury of cooling off or to take the tranquilizing drug of gradualismNow is the time to make real the promises of democracyNow is the time to rise from the dark and desolate valley of segregation to the sunlit path of racial justiceNow is the time to lift our nation from the quicksands of racial injustice to the solid rock of brotherhoodNow is the time to make justice a reality for all of God childrenIt would be fatal for the nation to overlook the urgency of the momentThis sweltering summer of the Negro legitimate discontent will not pass until there is an invigorating autumn of freedom and equalityNineteen sixty three is not an endbut a beginningAnd those who hope that the Negro needed to blow off steam and will now be content will have a rude awakening if the nation returns to business as usualAnd there will be neither rest nor tranquility in America until the Negro is granted his citizenship rightsThe whirlwinds of revolt will continue to shake the foundations of our nation until the bright day of justice emergesBut there is something that I must say to my peoplewho stand on the warm threshold which leads into the palace of justiceIn the process of gaining our rightful placewe must not be guilty of wrongful deedsLet us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatredWe must forever conduct our struggle on the high plane of dignity and disciplineWe must not allow our creative protest to degenerate into physical violenceAgain and againwe must rise to the majestic heights of meeting physical force with soul forceThe marvelous new militancy which has engulfed the Negro community must not lead us to a distrust of all white peoplefor many of our white brothersas evidenced by their presence here todayhave come to realize that their destiny is tied up with our destinyAnd they have come to realize that their freedom is inextricably bound to our freedom We cannot walk aloneAnd as we walkwe must make the pledge that we shall always march aheadWe cannot turn backThere are those who are asking the devotees of civil rightsWhen will you be satisfiedWe can never be satisfied as long as the Negro is the victim of the unspeakable horrors of police brutalityWe can never be satisfied as long as our bodiesheavy with the fatigue of travelcannot gain lodging in the motels of the highways and the hotels of the citiesWe cannot be satisfied as long as the negro basic mobility is from a smaller ghetto to a larger oneWe can never be satisfied as long as our children are stripped of their self hood and robbed of their dignity by signs statingFor Whites OnlyWe cannot be satisfied as long as a Negro in Mississippi cannot vote and a Negro in New York believes he has nothing for which to voteNonowe are not satisfiedand we will not be satisfied untiljustice rolls down like waters and righteousness like a mighty streamI am not unmindful that some of you have come here out of great trials and tribulationsSome of you have come fresh from narrow jail cellsAnd some of you have come from areas where your questquest for freedom left you battered by the storms of persecution and staggered by the winds of police brutalityYou have been the veterans of creative sufferingContinue to work with the faith that unearned suffering is redemptiveGo back to Mississippigo back to Alabamago back to South Carolinago back to Georgiago back to Louisianago back to the slums and ghettos of our northern citiesknowing that somehow this situation can and will be changedLet us not wallow in the valley of despairI say to you todaymy friendsAnd so even though we face the difficulties of today and tomorrowI still have a dreamIt is a dream deeply rooted in the American dreamI have a dream that one day this nation will rise up and live out the true meaning of its creedWe hold these truths to be self evident that all men are created equalI have a dream that one day on the red hills of Georgiathe sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhoodI have a dream that one day even the state of Mississippia state sweltering with the heat of injusticesweltering with the heat of oppressionwill be transformed into an oasis of freedom and justiceI have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character I have a dream todayI have a dream that one daydown in Alabamawith its vicious racistswith its governor having his lips dripping with the words of interposition and nullificationone day right there in Alabama little black boys and black girls will be able to join hands with little white boys and white girls as sisters and brothersI have a dream todayI have a dream that one day every valley shall be exaltedand every hill and mountain shall be made lowthe rough places will be made plainand the crooked places will be made straightand the glory of the Lord shall be revealed and all flesh shall see it togetherThis is our hopeand this is the faith that I go back to the South withWith this faithwe will be able to hew out of the mountain of despair a stone of hopeWith this faithwe will be able to transform the jangling discords of our nation into a beautiful symphony of brotherhoodWith this faithwe will be able to work togetherto pray togetherto struggle togetherto go to jail togetherto stand up for freedom togetherknowing that we will be free one dayAnd this will be the day this will be the day when all of God children will be able to sing with new meaningMy country tis of thee sweet land of liberty of thee I singLand where my fathers died land of the Pilgrim prideFrom every mountainside let freedom ringAnd if America is to be a great nation this must become trueAnd so let freedom ring from the prodigious hilltops of New HampshireLet freedom ring from the mighty mountains of New YorkLet freedom ring from the heightening Alleghenies of PennsylvaniaLet freedom ring from the snow capped Rockies of ColoradoLet freedom ring from the curvaceous slopes of CaliforniaBut not only thatLet freedom ring from Stone Mountain of GeorgiaLet freedom ring from Lookout Mountain of TennesseeLet freedom ring from every hill and molehill of MississippiFrom every mountainside let freedom ringAnd when this happens when we allow freedom ringwhen we let it ring from every village and every hamletfrom every state and every citywe will be able to speed up that day when all of God childrenblack men and white menJews and GentilesProtestants and Catholicswill be able to join hands and sing in the words of the old Negro spiritualFree at lastFree at lastThank God Almighty we are free at lastI have a dream over
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -