Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Java] An Idea - Polynomial Encryption

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Fri Aug 27, 2010 6:53 pm    Post subject: [Java] An Idea - Polynomial Encryption Reply with quote

I started reading some Alg2 stuff and thought of creating an encryption method based of Polynomial Equations to the outputs would have finite lengths. But my question is, would using this technique with a key work well?

I know it can be easily brute forced though by changing the key.

Equation Used:
Trinomial Encryption -> Output = (x+key)² + (x+key) + 1
Trinomial Decryption -> Output = (x+key)² + (x+key) + 1

Example:
Code:
    public static void PolyEnc(String input, int key){
        String Output = "";
        //Y = (x+key)² + (x+key) + 1
        for (int i = 0;i<input.length();i++){
            int coded = ((Integer.valueOf(input.charAt(i)))+key)^2 + ((Integer.valueOf(input.charAt(i)))+key) + 1;
            Output += "[" + String.valueOf(coded) + "]";
        }
        System.out.println(Output);
    }


I'm working on a decryption method. And I got some tables to start with it thats based of the trinomial.

Code:
--- chr = 1, key = 1; 7
--- chr = 2, key = 1; 10
--- chr = 3, key = 1; 13


--- chr = 1, key = 2; 10
--- chr = 2, key = 2; 13
--- chr = 3, key = 2; 16

--- chr = 1, key = 3; 13
--- chr = 2, key = 3; 16
--- chr = 3, key = 3; 19

_________________
CEF will always stay alive.


Last edited by Jorg hi on Sat Aug 28, 2010 8:35 am; edited 1 time in total
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sat Aug 28, 2010 6:20 am    Post subject: Re: [Java] An Idea - Polynomial Encryption Reply with quote

Jorghi wrote:
Trinomial Encryption -> Output = (x+key)2 + (x+key) + 1
Code:
int coded = ((Integer.valueOf(input.charAt(i)))+key)*2 + (

Isn't that code the same as (x+key)*3 + 1. Didn't you mean (x+key)² ?
Back to top
View user's profile Send private message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Sat Aug 28, 2010 8:14 am    Post subject: Reply with quote

Oh I didn't see that.
Thanks. Thats why the decryption had problems.

Code:
    public static void PolyEnc2(int input, int key){
        String Output = "";
        //Y = ((x+key)2 + (x+key) + 1) + x^key
        int coded = ((input+key)^2 + (input+key) + 1) + input^key;
        Output += "[" + String.valueOf(coded) + "]";
        System.out.println(Output);
    }


Edit: I removed the trinomial. It outputs the same values for different numbers. I'm adding a linear equation.

//Y = ((x+key)2 + (x+key) + 1) * ((x * key) + key)

_________________
CEF will always stay alive.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sat Aug 28, 2010 12:32 pm    Post subject: Reply with quote

Jorghi wrote:

int coded = ((input+key)^2 + (input+key) + 1) + input^key;

I don't know about Java, but in C the ^ operator is the xor operator. So in C (input+key)^2 would xor the output of (input+key) with 2. Might be different for Java though.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites