Σε Εξέλιξη

Convert C program to Java

Need the following C code converted into a Java library

[url removed, login to view]

This c++ to Java converter may help you [url removed, login to view]

I need the C code converted to nice Java code/classes.

It should be pretty easy/straightforward.

See rlwe_main.c for an example program.

Some requirements:

a) I would like a nice clean interface to the lib that makes it clean and easy to call the functions.

b) generateKeyPair needs to work with Java KeyPair.

Easy enough to do - you can subclass PublicKey and PrivateKey

by putting the uint32_t in the

public byte[] getEncoded() of [url removed, login to view]

c) assume CONSTANT_TIME is our default (see code)

d) Use java SecureRandom (passed in externally to interface)

for random numbers for rlwe_kex_generate_keypair

ie public KeyPair generateKeyPair(SecureRandom ........

e) Java test program should emulate the test logic in C main

(see below). Of course, the program must work and always

generate the same secret between Alice and Bob.

f) No statics in final - I need the final code to run in parallel with multiple threads

g) Ignore the C random number code - we should be using SecureRandom in the Java implementation.

** interface definition

I'll put the suggested mappings between old C and Java here. Chat if you want to do something different.

C:

rlwe_kex_generate_keypair(a, s_alice, b_alice, &ctx);

JAVA:

public KeyPair generateKeyPair( SecureRandom random);

C:

rlwe_kex_compute_key_bob(b_alice, s_bob, c, k_bob, &ctx);

JAVA:

BobResult computeBob( PublicKey alice, PrivateKey bob);

BobResult holds c (call it CResponse) and k (call it secret).

C:

rlwe_kex_compute_key_alice(b_bob, s_alice, c, k_alice, &ctx);

Java:

AliceResult computeAlice( PublicKey bob, PrivateKey alice,

CResponse response);

**

Hint:

Java Main test program should roughly contain

SecureRandom random = new SecureRandom();

KeyPair aliceKeyPair = generateKeyPair( random );

KeyPair bobKeyPair = generateKeyPair( random );

BobResult res = computeBob( [url removed, login to view](),

[url removed, login to view]());

AliceResult res2 = computeAlice( [url removed, login to view](),

[url removed, login to view](),

[url removed, login to view]() );

boolean keysMatch= [url removed, login to view]().equals( [url removed, login to view]() );

** Background logic to understand whats going on

Alice generates initiator polynomal (PubKey), gives it to Bob.

Bob takes initiator polynomial (alice pubkey) and now has secret (k), gives responding polynomials (C and pubkey bob) to Alice.

Alice takes responding polynomials (C and pubkey bob) and calculates secret (k).

We then run test to ensure that both Alice and Bob have the same secret.

Note:

All copyright must of completed work belong to me, This obviously also means you can't give the produced code to anyone else, in whole or in part.

*
Obviously, the Java code given to me must be bug free, fully working, and clean wherever possible,

Even though the c++ to java converter may be useful, you'll still to put some manual effort in.

The test code should clearly show the system works even when run many many times
(ie. if you put the main test loop and run it 100,000 times, the secret should match every time with different
public and private keys etc)


Δεξιότητες: Java

Δείτε περισσότερα: security logic, k to the i, help with java code, c random number library, convert java code to c, java program interactive user input guess number, using phone number java program, java program verifies password using indexof, java program library management using interface, convert code java program, convert flv mpeg java program, using java program card game

Σχετικά με τον Εργοδότη:
( 34 αξιολογήσεις ) Loughton, United Kingdom

ID Εργασίας: #8392777

Ανατέθηκε στον/στην:

vvadimov

Hello, I am an experienced both c++ and java programmer and I would like to do this project for you. I have experience in writing codes regarding cryptography (cryptohashes, crypto-algorithms like AES) so it won't be a Περισσότερα

$80 USD σε 3 μέρες
(48 Αξιολογήσεις)
5.5

17 freelancers κάνουν προσφορές με μέσο όρο $162 γι' αυτή τη δουλειά

super2lao

A proposal has not yet been provided

$252 USD σε 3 μέρες
(73 Αξιολογήσεις)
6.7
snpe

Hi, I'm experienced Java developer. See my github profile: [url removed, login to view] I would like to help you about this project. Regards, Peco

$277 USD σε 7 μέρες
(27 Αξιολογήσεις)
5.8
dipakjadhav08

A proposal has not yet been provided

$166 USD σε 5 μέρες
(68 Αξιολογήσεις)
5.1
phongpro

A proposal has not yet been provided

$55 USD σε 3 μέρες
(50 Αξιολογήσεις)
4.9
nxhoaf

Hi, Please have a chat with me to discuss more about the project. I will try to implement it and give you the demo via skype direct call and screen sharing. If you don't want my implementation, you can reject it wi Περισσότερα

$150 USD σε 3 μέρες
(23 Αξιολογήσεις)
4.4
zuiguanglong

A proposal has not yet been provided

$231 USD σε 3 μέρες
(9 Αξιολογήσεις)
4.1
cscinstructor

I have read and fully understood your requirements.. Please open chat to discuss further… _____________________-----------------------------------_____________________________------------------

$277 USD σε 3 μέρες
(8 Αξιολογήσεις)
3.7
dk2k

Предложение еще не подано

$188 USD σε 5 μέρες
(5 Αξιολογήσεις)
2.6
maryamOmar791

Hello I am a java developer and I have alot of experience in software development Looking forward to hear from [url removed, login to view]!

$100 USD σε 3 μέρες
(2 Αξιολογήσεις)
1.9
mmallis87

A proposal has not yet been provided

$133 USD σε 5 μέρες
(3 Αξιολογήσεις)
1.4
k122156

A proposal has not yet been provided

$188 USD σε 3 μέρες
(0 Αξιολογήσεις)
0.0
WhatTechnologies

A proposal has not yet been provided

$193 USD σε 5 μέρες
(0 Αξιολογήσεις)
0.0
ajaykumar112792

i can do this job. -------------------------------------------------------------------------------------------------------

$150 USD σε 3 μέρες
(0 Αξιολογήσεις)
0.0
hz89gp23n

A proposal has not yet been provided

$111 USD σε 5 μέρες
(0 Αξιολογήσεις)
0.0
mtby

I have experience with both c and java. I would convert it on my own, not using converter. I would deliver clean code.

$150 USD σε 5 μέρες
(0 Αξιολογήσεις)
0.0
swaaminathan93

A proposal has not yet been provided

$61 USD σε 3 μέρες
(0 Αξιολογήσεις)
0.0