What kind of decryption algorithm could this be? [closed] - cryptography

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
for a assignment in our university we have to find the decryption algorithm for a ciphertext.
I already found the correct decryption for every letter but i still dont know wich cipher is used. (Our only hint was its kinda like the caesar cipher)
(This is how letters are decrypted. First row is converted to third row, i have also written the number of the letter in the alphabet to maybe find some numeric decrypt algorithm)
Here is the ciphertext. For those who are interested in it:
xituih, rinsyf ltgiqtl mwc liqu sy mrim bgixt, ktxieut rt ril
iymsxsbimtl mrim, sy mrt yimehig xcehut ca tntymu, uexr wcegl kt mrt
xcylexm ca nthxsyftmchsv, gtintu mrt ihdq eylth bhtmtyut ca hisusyf
htxhesmu iyl xinighq: rt bgixtu khemeu, i qceyf diy, sy xcddiyl ca
mrtut achxtu; rt fsntu rsd syumhexmscyu mrim mrt xinighq urcegl hiyft
iu tvmtyusntgq iu bcuuskgt sy igg lshtxmscyu; mrim rt wcegl tvthm
rsdutga ycm mc kt ikutym ahcd mrt xidb gcyfth mriy mrhtt liqu. rinsyf
ihhiyftl mrtut dimmthu, rt dihxrtu mc nstyyi kq iu gcyf zcehytqu iu rt
xiy, wrty rsu cwy ucglsthu lsl ycm tvbtxm rsd. asylsyf mrtht i ahtur
kclq ca xinighq, wrsxr rt ril utym cy mc mrim bgixt utnthig liqu
ktacht, dihxrsyf syxtuuiymgq ysfrm iyl liq, rt ilniyxtl hibslgq
mrhcefr mrt mthhsmchq ca mrt itles symc mrim ca mrt gsyfcytu, sy wrsxr
mwc gtfscyu wtht wsymthsyf, mrim, sa iyq bgiy iaatxmsyf rsu cwy uiatmq
urcegl rint ktty chfiysotl kq mrt itles, rt dsfrm ltatim sm kq mrt
hibslsmq ca rsu dcntdtymu. wrty rt ihhsntl mrtht, rt utylu syachdimscy
mc mrt htum ca mrt gtfscyu, iyl fimrthu igg rsu ihdq symc cyt bgixt
ktacht symtggsftyxt ca rsu ihhsnig xcegl kt iyyceyxtl mc mrt ihnthys.
nthxsyftmchsv, cy rtihsyf mrsu xshxedumiyxt, gtilu kixj rsu ihdq symc
mrt xceymhq ca mrt ksmehsftu; iyl iamth dihxrsyf ahcd sm mc fthfcnsi,
i mcwy ca mrt kcss, wrcd xituih ril utmmgtl mrtht iamth ltatimsyf mrtd
sy mrt rtgntmsiy wih, iyl ril htylthtl mhskemihq mc mrt itles, rt
ltmthdsytl mc immixj sm.
The only possible algorithm i found until now is the simple substition with a new alphabet which in my case is fpomuglr....q But im not sure if its really just that.
I know this is actually a board for asking programming questions, but since this is kinda programming related and i know there are a some programming people who are really into cryptography i decided to ask you guys if you maybe find some algorithm in it. Furthermore when we found the actual decryption algorithm we also have to code it.
Greets Jack

The first step to break the cipher would be do a frequency attack on it. Should be particularly effective in case of a Caesar cipher.
http://en.wikipedia.org/wiki/Frequency_analysis
There are also a whole bunch of tools to help you, all posted under scientific curiosity :)
http://csc.fsksm.utm.my/syed/projects/cryptography.html

Related

SQL count function for specific value [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 19 days ago.
Improve this question
SELECT nomDepar, ciudadSede, count(idempleado) as "Numero de Empleados"
from departamentos d, sedes s, empleados
where d.idSede = s.idSede
and s.ciudadSede in ('Madrid')
group by nomdepar, ciudadsede
I am trying to count all the employees in the departments located in Madrid. This is what I have so far but I am stuck here. It might be obvious but I only started learning SQL 2 weeks ago and this is stressing me out.
Just guessing, but it should be like here:
SELECT d.nomDepar, s.ciudadSede, count(e.idempleado) as "Numero_de_Empleados"
FROM departamentos d
INNER JOIN sedes s ON(s.idSede = d.idSede)
INNER JOIN empleados e ON(e.idSede = d.idSede) -- just guessing this join condition - you should put your own - there was none in your code
WHERE s.ciudadSede = 'Madrid'
GROUP BY d.nomDepar, s.ciudadSede

How do I understand the commas happening in join statements?

I am running into a legendary code and have been struggling in breaking this down in more simpler terms. The legendary code runs perfectly. I am copying the join part of the code and not including the select for brevity. I extremely familiar with joins but I want to focus on two pieces
1.) What does FROM COURSE c, GRADE g this try to achieve? How is it know how to do it?
2.) What does this do GRADEITEM gs, STUDENT s, SECTION sec when these tables are listed with commas after the inner join occured? Aren't I missing an on for these three tables tables?
FROM COURSE c, GRADE g
INNER JOIN CEC cc
ON g.SectionID = cc.SectionID AND g.StudentID = cc.StudentID, GRADEITEM gs, STUDENT s, SECTION sec
This code:
FROM COURSE c,
GRADE g INNER JOIN
CEC cc
ON g.SectionID = cc.SectionID AND g.StudentID = cc.StudentID, GRADEITEM gs,
STUDENT s,
SECTION sec
is very arcane (which like "legendary" is a polite way of saying what I really think).
This is equivalent to:
FROM COURSE c
GRADE g
ON g.StudentID = cc.StudentID INNER JOIN
CEC cc
ON g.SectionID = cc.SectionID CROSS JOIN
GRADEITEM gs CROSS JOIN
STUDENT s CROSS JOIN
SECTION sec
The comma basically means CROSS JOIN. I rewrite the first CROSS JOIN to be the intended JOIN by splitting the ON clause.
The rest are just Cartesian products. I imagine that the WHERE clause provides more filtering.
"Arcane" and "archaic" are polite ways of describing the code. This is very poorly written code. If Cartesian products are intended, then CROSS JOIN is appropriate. That said, I'm pretty sure that JOINs are intended for all the tables -- for any useful query.

Move rows to columns in SQL Server

I have tried using PIVOT and other methods to fix a problem, but I seem to be stuck.
CustomerID Question Answer
...........................................................
469494 Q111 Mottok e-post
469494 Q125 Ja
469494 Q112 Ja
469494 Q113 Ingeniør eller bachelor i tekn
469494 Q16 6 Meget bra
I need each customer row to inlude all answers, and the columns to be the value of Question key. Like This:
CustomerID Q111 Q125 Q112 Q113 (etc)
.........................................................................................
469494 Mottok e-post Ja Ja Ingeniør eller bachelor i tekn
There are multiple customers answering. And some answers are freetext.
My main problem here is that The Questions - and ofcourse - the answers are dynamic. They are answering a questionnaire, and this is a report that should be able to run and extract info for a specific questionnaire, with different Question keys and number of questions may also vary.
I didn't manage to do this with the PIVOT function, as the values differ.

Query to select the record description with the latest open date [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Table Case_ACTIONS
CASE_ID SEQ_NUM DATE_OPEN DATE_DUE CODE DESCREPTION_J
153286253 64125995 9/21/2013 9/28/2013 23001954 有害事象連絡票
153286253 64125996 9/23/2013 9/29/2013 23001938 PMS-SAE/AE報告書
Table LM_ACTION_ITEM_TYPE
ACTION_TYPE_ID ACTION_TYPE
23001954 JP FU AE Report Frm
23001938 JP FU with pregnancy
I want to select DESCREPTION_J for the latest record of the types 'JP FU AE Report Frm' or 'JP FU with pregnancy '
The query I have written is :
select
description_j
from
case_actions
where
date_open = (select MAX(ca.date_open)
from case_actions ca, LM_ACTION_ITEM_TYPE lat
where ca.code = lat.action_type_id
and lat.action_type IN ('JP FU AE Report Frm – Contact Record', 'JP FU AE Report Frm–Detail Invest. Frm','JP FU with pregnancy form')
and ca.case_id = :P_LET_CASE_ID and ca.action_status = 1
and ca.deleted is NULL)
and it is giving me incorrect data. Please help.
You must correlate the outer query with the inner query, otherwise you may get case_actions that only have in common the date (and not the other filters in the subquery).
With this sample data:
With case_id=153286253 your query would give bbb and ddd. But ddd has a different case_id and code, which I don't think you want.
Adding and ca.case_id = case_actions.case_id to the inner query gives bbb, which I believe is the result you expect.
Firstly you should always give the entire table structure definition.
Anyways, based on your sample query I could think of something.
Try this.
select ca.description_j
from case_actions ca
where ca.date_open = (select MAX(ca.date_open)
from lm_action_item_type lat
where ca.code = lat.action_type_id
and lat.action_type IN ('JP FU AE Report Frm Contact Record', 'JP FU AE Report Frm Detail Invest. Frm','JP FU with pregnancy form')
and ca.case_id = :P_LET_CASE_ID
and ca.action_status = 1
and ca.deleted is NULL)

chaning the view/style of sql xml auto

i have the below peice of code (following on for my earlier question SQL How to list Columns in a Table as a Cursor Statement)
select
(select * from
(select Narrative
from OfficeClientLedger
where ptMatter=$Matter$ and ptTrans = 4)
as Disbursments for xml auto)
Which returns
<OFFICECLIENTLEDGER NARRATIVE="M0604/20 Cwm Taff NHS Trust Medical Records (C)"/><OFFICECLIENTLEDGER NARRATIVE="M0604/210 Dr Purby Medeical Records (C)"/><OFFICECLIENTLEDGER NARRATIVE="M0604.20 Orchid Cellmark tld Fee"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Parsons Dowd Psychological Ltd Assessment Fees"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Dr R Oretti Drug testing"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Correction of MIssposting CQ 013524"/><OFFICECLIENTLEDGER NARRATIVE="M0604/20 Helen Blackler Assessment Fees (P) "/>
However, I need it to bring me a list such as
M0604/20 Cwm Taff NHS Trust Medical
Records (C)
M0604/210 Dr Purby Medeical Records
(C)
M0604.20 Orchid Cellmark tld Fee
M0604/20 Parsons Dowd
M0604/20 Dr R Oretti Drug testing
M0604/20 Correction of MIssposting CQ
013524
M0604/20 Helen Blackler Assessment
Fees (P)
any ideas? thanks
select
(select cast(Narrative as varchar(max))
from OfficeClientLedger
where ptMatter=$Matter$ and ptTrans = 4
as Disbursments for xml path(''), true)
You could use an XSL style sheet to change the format of the XML retrieved from SQL Server.
http://sqlxml.org/faqs.aspx?faq=99