#7124: affine cipher and its cryptanalysis
----------------------------+-----------------------------------------------
Reporter: mvngu | Owner: somebody
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.2
Component: cryptography | Keywords: affine cipher
Work_issues: | Author: Minh Van Nguyen
Reviewer: | Merged:
----------------------------+-----------------------------------------------
Changes (by mvngu):
* status: needs_review => needs_work
Comment:
At present, here's what happening with the method `brute_force()`: it
returns a list of lists `L` that contains all the possible decipherments.
And that's it, not even the key that results in a candidate decipherment.
If you think the present behaviour is confusing, yes, I agree with that.
Here's a sample session.
{{{
sage: A = AffineCryptosystem(AlphabeticStrings())
sage: cipher = A(11, 4)
sage: P = A.encoding("Have a nice day at the seashore.")
sage: C = cipher(P); C
DEBWEROAWLEIEFFDWUWEUDCJW
sage: candidates = A.brute_force(C)
sage: candidates[1]
[DEBWEROAWLEIEFFDWUWEUDCJW,
CDAVDQNZVKDHDEECVTVDTCBIV,
BCZUCPMYUJCGCDDBUSUCSBAHU,
ABYTBOLXTIBFBCCATRTBRAZGT,
ZAXSANKWSHAEABBZSQSAQZYFS,
YZWRZMJVRGZDZAAYRPRZPYXER,
XYVQYLIUQFYCYZZXQOQYOXWDQ,
WXUPXKHTPEXBXYYWPNPXNWVCP,
VWTOWJGSODWAWXXVOMOWMVUBO,
UVSNVIFRNCVZVWWUNLNVLUTAN,
TURMUHEQMBUYUVVTMKMUKTSZM,
STQLTGDPLATXTUUSLJLTJSRYL,
RSPKSFCOKZSWSTTRKIKSIRQXK,
QROJREBNJYRVRSSQJHJRHQPWJ,
PQNIQDAMIXQUQRRPIGIQGPOVI,
OPMHPCZLHWPTPQQOHFHPFONUH,
NOLGOBYKGVOSOPPNGEGOENMTG,
MNKFNAXJFUNRNOOMFDFNDMLSF,
LMJEMZWIETMQMNNLECEMCLKRE,
KLIDLYVHDSLPLMMKDBDLBKJQD,
JKHCKXUGCRKOKLLJCACKAJIPC,
IJGBJWTFBQJNJKKIBZBJZIHOB,
HIFAIVSEAPIMIJJHAYAIYHGNA,
GHEZHURDZOHLHIIGZXZHXGFMZ,
FGDYGTQCYNGKGHHFYWYGWFELY,
EFCXFSPBXMFJFGGEXVXFVEDKX]
}}}
I think this is perhaps why you said the output of `brute_force()` is odd.
In the method `brute_force()` of the shift cipher from #7123, it provides
both the key together with the corresponding candidate decipherment. In
the current affine cipher implementation, I forgot about the output of the
brute force method in #7123. OK, move to "needs work" again.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7124#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---