Results 1 to 2 of 2
- 07-01-2011, 09:23 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 3
- Rep Power
- 0
Best way to model table with header characters?
Hi guys,
I'm looking for the best way to model this table in Java.
I thought about using seperate Arrays but it a) seems cumbersome b) Arrays don't have a key (index) character.
Eventually my method will:
Accept two string inputs (a plaintext & a key)
For example, suppose that the plaintext to be encrypted is:
ATTACKATDAWN
The person sending the message chooses a keyword and repeats it until it matches the length of the plaintext, for example, the keyword "LEMON":
LEMONLEMONLE
The first letter of the plaintext, A, is paired with L, the first letter of the key. So use row L and column A of the Vigenère square, namely L. Similarly, for the second letter of the plaintext, the second letter of the key is used; the letter at row E and column T is X. The rest of the plaintext is enciphered in a similar fashion:
Plaintext: ATTACKATDAWN
Key: LEMONLEMONLE
Ciphertext: LXFOPVEFRNHR
- 07-01-2011, 01:44 PM #2
Given that the collating sequence for the letters you are using doesn't have any holes. The letters are contiguous, You could compute an index into an array by giving the letter A the value of 0 and subtracting the value of A from the letter to get the index. The indexes would be 0-25 for A to ZArrays don't have a key (index) character
Similar Threads
-
How to change the height of a table header?
By Zelord in forum AWT / SwingReplies: 2Last Post: 12-20-2010, 08:08 PM -
DisplayTag Table header styling problem and paging
By selvi in forum Web FrameworksReplies: 1Last Post: 08-06-2010, 11:00 AM -
Copy Default table model to another default table model?
By greatmajestics in forum AWT / SwingReplies: 2Last Post: 04-28-2010, 04:08 PM -
How to repaint.refresh the table (table model) with combo box selection envent
By man4ish in forum AWT / SwingReplies: 1Last Post: 01-08-2010, 06:19 AM -
Table model
By Manfizy in forum NetBeansReplies: 4Last Post: 11-08-2008, 02:19 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks