How to decrypt this transposition cipher? [closed] - algorithm

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
My problem is that I am trying to decrypt following cipher text:
AWGNEYDTBSREAHGIDEIEEIHKIWABHPRCROIWSSBHTE
OCSNASLAIGTTOTYIOBNANNOOCHENEHSADUAIEOSNTH
TEOOAWUTOVTISNTVIFIHSNADVOGOREAPTBETSIT
DCSNASAAHOOULITUREICBNOERSNETTNOITTNTSDEOO
RERNINTOVTINTEFKGITPRCROEEIGREIGREHKFN
HOCWHPDTOSREGTOUREINDIUATHCHIEOSN
I know that it is English language. I know that it was encrypted only once by substitution, monoalphabetic or transposition.
I checked the Index of Coincidence and I received: 0.06833754056978002
I also checked frequency of letter and I received:
T 11.02, E 10.59, O 10.16, I 9.74, N 8.47, S 6.77, A 6.35, R 5.93, H 5.93, G 3.38, D 3.38, C 3.38, U 2.54, B 2.54, W 2.11, V 1.69, P 1.69, K 1.27, F 1.27, Y 0.84, L 0.84.
So I claim that it is transposition cipher. Am I right?
I checked all combinations of Rail Fence Transposition. I did not receive something sensible.
I checked all combinations of Columnar Transposition without changing order. I did not receive something sensible.
I checked a few combinations of Columnar Transposition with changing order. I did not receive something sensible.
Do you have idea how I can resolve this interesting task?

Related

Is my symmetric encryption algorithm safe? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
I recently decided to write my own symmetric encryption program (which could be used in a custom password manager for example).
I would like your opinion about him, did I make big mistakes? else would it be easily breakable?
It is basically a Vigenere fork trying to get closer to the principles of Vernam encryption but remaining easy to use (you can use any key in order to encrypt your text).
How does it work?
You enter a message (e.g. hello world) and a seed (e.g. seed).
The seed is transformed into a number thanks to a hash function
We add the number of letters of the message to this number, and we hash it another time
A pseudo-random number generator is initialized with the result and a list of random numbers of the text size is generated (it's the key).
We shift each letter with the corresponding number in the list (the first letter of the message is shifted with the first number of our generated list)
Example :
Alphabet: [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
List : [1,18,3,17,0]
Word: "hello"
h+1 = j
e+18 = w
l+3 = o
l+17=c (as the alphabet is finished, we continue at the beginning)
o+0=o
Output: "jwoco"
The principles of Vernam encryption specifies that :
the key used to offset the letters must be at least as large as the text size -> It's okay
The key must only be used once -> It's okay if you change your seed or the size of the message (since we include the text size in the hash used to initialize the key)
The key must be completely random -> This will depend on the random number generation algorithm and the hash algorithm but if they are good we should have an output with which it is impossible without the key to find a text that is more likely than another to be the original message.
Is my explanation clear? Do you agree with me? Do you have any clarifications to add? improvements to propose or algorithms of random number generation and hash to advise me?
have a nice day,
Thomas!
A relevant anecdote from Bruce Schneier:
See https://www.schneier.com/crypto-gram/archives/1998/1015.html#cipherdesign
A cryptographer friend tells the story of an amateur who kept
bothering him with the cipher he invented. The cryptographer would
break the cipher, the amateur would make a change to "fix" it, and the
cryptographer would break it again. This exchange went on a few times
until the cryptographer became fed up. When the amateur visited him to
hear what the cryptographer thought, the cryptographer put three
envelopes face down on the table. "In each of these envelopes is an
attack against your cipher. Take one and read it. Don't come back
until you've discovered the other two attacks." The amateur was never
heard from again.
Use AES.

Stack implementation the Trollface way [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
In my software engineering course, I encountered the following characteristic of a stack, condensed by me: What you push is what you pop. The fully axiomatic version I Uled here.
Being a natural-born troll, I immediately invented the Troll Stack. If it has more than 1 element already on it, pushing results in a random permutation of those elements. Promptly I got into an argument with the lecturers whether this nonsense implementation actually violates the axioms. I said no, the top element stays where it is. They said yes, somehow you can recursively apply the push-pop-axiom to get "deeper". Which I don't see. Who is right?
The violated axiom is pop(push(s,x)) = s. Take a stack s with n > 1 distinct entries. If you implement push such that push(s,x) is s'x with s' being a random permutation of s, then since pop is a function, you have a problem: how do you reverse random_permutation() such that pop(push(s,x)) = s? The preimage of s' might have been any of the n! > 1 permutations of s, and no matter which one you map to, there are n! - 1 > 0 other original permutations s'' for which pop(push(s'',x)) != s''.
In cases like this, which might be very easy to see for everybody but not for you (hence your usage of the "troll" word), it always helps to simply run the "program" on a piece of paper.
Write down what happens when you push and pop a few times, and you will see.
You should also be able to see how those axioms correspond very closely to the actual behaviour of your stack; they are not just there for fun, but they deeply (in multiple meanings of the word) specify the data structure with its methods. You could even view them as a "formal system" describing the ins and outs of stacks.
Note that it is still good for you to be sceptic; this leads to a) better insight and b) detection of errors your superiours make. In this case they are right, but there are cases where it can save you a lot of time (e.g. while searching the solution for the "MU" riddle in "Gödel, Escher, Bach", which would be an excellent read for you, I think).

Sort code in Prolog [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I'm writing a program in prolog and need some help. This could probably be considered a homework question.
I have two sort algorithms written and working. My goal is to pass in a list, and if it is greateror equal to than length 5, use sort method 1. if it's less than 5, use sort method 2. The sort methods both return a sorted list, and the main method that they are used in should return the sorted list.
here's the main method that I'm working with:
%Main method to run program
main(List, Result) :-
size(List, N),
( N => 5;
sort1(List, X),
sort2(List, X)).
Every time I try to run this, though, I get an error:
?- main([1,5,1,4,2,6,1]).
ERROR: Undefined procedure: main/1
ERROR: However, there are definitions for:
ERROR: main/2
false.
I'm not sure what this error means. Could anyone help me please?
You must correct the syntax. From your description:
main(List, Result) :-
length(List, N),
( N >= 5
-> sort1(List, Result)
; sort2(List, Result)
).

Password Algorithm [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
Could anyone tell me what type of Algotithm/Hash Function the following passwords use?
password: scrambled text
hhhhhhhhhhhhhhh : .!_-*/P_.!_-*/P
iiiiiiiiiiiiiii : / ^,+.Q^/ ^,+.Q
jjjjjjjjjjjjjjj : ,#]/(-R],#]/(-R
kkkkkkkkkkkkkkk : -"\.),S\-"\.),S
lllllllllllllll : *%[).+T[*%[).+T
It just looks like
char[i] = someMap[i%6, char[i%6]]
and the someMap[i] submaps are sequentially taken from ascii.
You don't have to guess the exact formula to reproduce it : a char of ascii code c at index i%6 always give the same char, so, with 127 tests (or more if you want to handle more chars), you can build your own map of dimension 127 x 6.
Note that it's impossible with your small test data to be sure there is no cumulative function in which a permutation could be function of the precedent char.

Matlab code optimization [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
f = #(w) test(w, phis, t, r_coeff);
function test(w, phis, t, r_coeff)
M = size(phis, 2);
expt = exp(-t .* (phis * w'));
coeff = expt .* t .^ 2 ./ (1 + expt) .^ 2;
averaging_coef = 1.0 / M; % mean replace
G = bsxfun(#times, phis', coeff' * averaging_coef) * phis + 2 * r_coeff * eye(M);
end
w - size is (1xM)
phis - size is (NxM)
t - size is (Nx1)
r_coeff is const
Help me please to optimize this piece of code, because function f runs a thousand times and N is around 300-800, M have mostly the same size. When I'm doing this * phis performance goes down.
As you can see it depends only on w - which I don't know.
It already is fairly well "optimized". Just because you want it to run faster does not make that possible.
You can buy/find/borrow/lease a faster/bigger computer. You can choose to solve smaller problems. You can just let it run overnight. Or you can change your problem to be something simpler and approximate, that runs more quickly.
This is what happens in research problems. They expand to the limits of your capability and just a bit more, because solving something easy is not worth a paper or a thesis. Computers make it easy to gather much data too, so problems get surprisingly large very quickly.
A special, rare skill in mathematics and modeling is knowing how to simplify your problem, deleting terms that are not truly important, while retaining the same basic behavior that you wish to study. This often involves linear approximations to nonlinear terms.

Resources