Javascript text encryption

I have inherited a web site to look after. The site is programmed in ASP which I'm not too familiar with but this issue seems to be java related.

On the main page of the site is the client's email address. This appears to be encoded within the source code using javascript. I now need to change the email address but I can't seem to find the origin of the script in order to work out how to create a new encryption code.

Does anyone recognise this and can they point me in the right direction please?

NOTE: I've changed the values within the code since I don't yet understand it and don't want to unintentionally release any client related data into the public domain.
<head>
<script language="javascript">function d(o){q="asdfgsadfgsdagasdfhasfgas";k=0;s="";for(i=0;i<o.length;i=i+2){c="0x"+o.substr(i,2);c=Math.abs(c-q.charCodeAt(k));k++;if(k>q.length-1)k=0;c=String.fromCharCode(c);s+=c;}document.write(s);}</script>
</head>

<body>
d('d1jk34jk34jh34jh34jk25j25jkj235mk34kmnl34knl34jkl235kl235235nkl235kl')

</body>

Open in new window

LVL 1
edz_pgtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
Why do you want to let the encryption ? Remove it and put directly your email with or without another encryption method...
0
edz_pgtAuthor Commented:
hmm... well, currently I don't have another method of doing this encryption and taking it away would be a reduction in spam control from the clietns perspective so I can't justify that.
0
leakim971PluritechnicianCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leakim971PluritechnicianCommented:
To encode use :


function e(o) {
		q="asdfgsadfgsdagasdfhasfgas";
		k=0;
		s="";
		for(i=0;i<o.length;i++) {
			c = o.charCodeAt(i) + q.charCodeAt(k);
			k++;
			if(k>q.length-1) k=0;
			s+=c.toString(16);
		}
		document.write(s);
	}

Open in new window

0
leakim971PluritechnicianCommented:
Test page :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	function d(o) {
		q="asdfgsadfgsdagasdfhasfgas";
		k=0;
		s="";
		for(i=0;i<o.length;i=i+2) {
			c="0x"+o.substr(i,2);
			c=Math.abs(c-q.charCodeAt(k));
			k++;
			if(k>q.length-1) k=0;
			c=String.fromCharCode(c);
			s+=c;
		}
		document.write(s);
	}
	function e(o) {
		q="asdfgsadfgsdagasdfhasfgas";
		k=0;
		s="";
		for(i=0;i<o.length;i++) {
			c = o.charCodeAt(i) + q.charCodeAt(k);
			k++;
			if(k>q.length-1) k=0;
			s+=c.toString(16);
		}
		document.write(s);
	}
</script>
</head>
<body>
<script language="javascript">
	d('cfe2d6cbd7dfdaa4cbdfe3c9d3dbd4a0c9decbc9d4d4cec6a1c4e2d1');
</script>
</body>
</html>

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.