[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

(Programming) Inverse Permutation Function with a Secret Key (for cryptography).. I just need help understanding what to do

Posted on 2011-04-19
6
Medium Priority
?
670 Views
Last Modified: 2012-05-11
*full instructions in the attached picture*

I just have to program these two methods (just psuedo code)... but I'm not sure what to do with int[] z.

static char[] encrypt(char[] x, int[] z)
static char[] decrypt(char[] y, int[] z)


If i understand correctly...if I have an array of:

A B C D E

i would return

E D C B A

but i'm not sure what to do with the the Z array.

please help~!  due at midnight today
nocturn4l-446009.flv
0
Comment
Question by:nocturn4l
  • 3
  • 3
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 35430131
sounds like you need to use z as an index of the element

so in your loop you would do something like:


encrypted[i] = x[z[i]];

Open in new window

0
 

Author Comment

by:nocturn4l
ID: 35430155
think i'm jus retarded... but do you think you can maybe elaborate further what you mean?  maybe using an example of the A B C D E example i gave?
0
 

Author Comment

by:nocturn4l
ID: 35430160
for example, the encrypt function.. .the A B C D E would be passed into the function through the x array i believe.. but what would be in the z array then?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 35430184
> but what would be in the z array then?

array indexes, eg.

A B C D, 0 2 3 1 = A C D B
0
 
LVL 92

Expert Comment

by:objects
ID: 35430202
0
 

Author Comment

by:nocturn4l
ID: 35430208
ah ok i get it, thanks objects.   you've helped me in the past many times before.  i'll close the question when i finish just incase i have any other questions
0

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month20 days, 2 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question