Find Jobs
Hire Freelancers

Convert C program to Java

$30-250 USD

Completed
Posted over 8 years ago

$30-250 USD

Paid on delivery
Need the following C code converted into a Java library [login to view URL] This c++ to Java converter may help you [login to view URL] 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 [login to view URL] 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( [login to view URL](), [login to view URL]()); AliceResult res2 = computeAlice( [login to view URL](), [login to view URL](), [login to view URL]() ); boolean keysMatch= [login to view URL]().equals( [login to view URL]() ); ** 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.
Project ID: 8392777

About the project

17 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
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 problem for me. Thank you in advance
$80 USD in 3 days
5.0 (48 reviews)
5.5
5.5
17 freelancers are bidding on average $162 USD for this job
User Avatar
A proposal has not yet been provided
$252 USD in 3 days
5.0 (95 reviews)
7.0
7.0
User Avatar
A proposal has not yet been provided
$166 USD in 5 days
4.9 (91 reviews)
5.4
5.4
User Avatar
A proposal has not yet been provided
$55 USD in 3 days
4.8 (50 reviews)
4.8
4.8
User Avatar
A proposal has not yet been provided
$231 USD in 3 days
4.9 (9 reviews)
4.1
4.1
User Avatar
I have read and fully understood your requirements.. Please open chat to discuss further… _____________________-----------------------------------_____________________________------------------
$277 USD in 3 days
4.7 (8 reviews)
3.7
3.7
User Avatar
Предложение еще не подано
$188 USD in 5 days
4.9 (5 reviews)
2.5
2.5
User Avatar
A proposal has not yet been provided
$133 USD in 5 days
5.0 (3 reviews)
1.4
1.4
User Avatar
A proposal has not yet been provided
$188 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$193 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
i can do this job. -------------------------------------------------------------------------------------------------------
$150 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$111 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
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 in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$61 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
Loughton, United Kingdom
5.0
34
Payment method verified
Member since Aug 23, 2005

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.