A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

So...I made my own encoding method...

929 views · started by Awesomolocity ·
#1
So...I made my own encoding method...
String.prototype.aEncode = function(){
var ar = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.!?/&#%=+-~_*'.split(''), a = this.length, x, y = '', z;
var b = ar.length;
if((a+2)%2 == 0){
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
}
}
else{
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
}
}
return y;
}
String.prototype.aDecode = function(){
var ar = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.!?/&#%=+-~_*'.split(''), a = this.length, x, y = '', z;
var b = ar.length;
if((a+2)%2 == 0){
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
}
}
else{
for(i = 0; i<a;i++){
if((i+2)%2 == 0){
x = ((ar.indexOf(this[i])-a)+b)%b;
y += ar[x];
}
else{
x = ((ar.indexOf(this[i])+a)+b)%b;
y += ar[x];
}
}
}
return y;
}[/x][/i][/x][/i][/x][/i][/x][/i][/x][/i][/x][/i][/x][/i][/x][/i]


Usage:
'somestring'.aEncode();//iycoiDhsdq


Not exactly sure why someone would use it, but it's cool. I guess it would be nice for like...keeping messages or a password secret.
#2
Great job actually.
I love seeing custom encoding algorithms.

But yeah, there wouldn't actually be much use for this.

The thing about an encryption algorithm is that you use the tried and trusted methods.
Not the cool new thing that just came out.

You want the algorithm that has been vulnerability tested for as long as possible so that you know you're getting the most out of your security.
#3
Isonyx wrote:
Great job actually.
I love seeing custom encoding algorithms.

But yeah, there wouldn't actually be much use for this.

The thing about an encryption algorithm is that you use the tried and trusted methods.
Not the cool new thing that just came out.

You want the algorithm that has been vulnerability tested for as long as possible so that you know you're getting the most out of your security.


I read a book about that, I forget what it was called. To test some new encryption algorithm that the guy invented, he encrypted some insane government secrets in it and released it into the wild, and even the government couldn't crack it.
#4
Isonyx wrote:
Great job actually.
I love seeing custom encoding algorithms.

But yeah, there wouldn't actually be much use for this.

The thing about an encryption algorithm is that you use the tried and trusted methods.
Not the cool new thing that just came out.

You want the algorithm that has been vulnerability tested for as long as possible so that you know you're getting the most out of your security.


I actually want to try to figure out a way to encrypt or even hash data. (Actually...encrypt...I like to know if I can get it back. xD)

I made this in real life, actually. Decided to port it to javascript. xD
I should use keycodes instead of an array though.
#5
I actually want to try to figure out a way to encrypt or even hash data. (Actually...encrypt...I like to know if I can get it back. xD)

I made this in real life, actually. Decided to port it to javascript. xD
I should use keycodes instead of an array though.


Be careful, though! Unless your algorithm closely resembles a current real-world one, it could be highly crackable. Like they said, you have to try to get people to try to crack it to see if it's secure.
#6
Be careful, though! Unless your algorithm closely resembles a current real-world one, it could be highly crackable. Like they said, you have to try to get people to try to crack it to see if it's secure.


If I did make some encryption or hashing method, I would definitely try to get people to crack it. :3
#7
If I did make some encryption or hashing method, I would definitely try to get people to crack it. :3


Yeah. He's just saying be careful implementing it anywhere significant until you've gone through a rigorous process of testing.
#8
Isonyx wrote:
Yeah. He's just saying be careful implementing it anywhere significant until you've gone through a rigorous process of testing.


Oh yeah, definitely. c: