473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ColdFusion Encrypt/Decrypt functions in .NET

Hello, all!

I'm faced with next problem.

I have ASP.NET page which takes url-parameters from ColdFusion site.
These parameters are encrypted with ColdFusion Encrypt function and I
can not decrypt them correctly. I tried to translate several code
examples (in java and C++) I had found on the Internet into C# but they
don't work properly.

I believe that I'm not the first one who met such a problem. If anybody
have ideas (or even codes) please help.

Thanks in advance!

Simon.

Jan 3 '07 #1
4 4025
According to Macromedia, The ColdFusion Encrypt function uses an XOR-based
algorithm that utilizes a pseudo random 32-bit key based on a seed passed by
the user as a parameter to the function. The resulting data is UUencoded.

You'll need to uudecode the encoded value first
http://www.eggheadcafe.com/printsear...asp?linkid=351

and then XOR it using the key it was encrypted with.
http://www.java2s.com/Code/CSharp/La...deamessage.htm

If you dont have the key - your wasting yuor time.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"dusiapapa" <sd*****@gmail.comwrote in message
news:11*********************@a3g2000cwd.googlegrou ps.com...
Hello, all!

I'm faced with next problem.

I have ASP.NET page which takes url-parameters from ColdFusion site.
These parameters are encrypted with ColdFusion Encrypt function and I
can not decrypt them correctly. I tried to translate several code
examples (in java and C++) I had found on the Internet into C# but they
don't work properly.

I believe that I'm not the first one who met such a problem. If anybody
have ideas (or even codes) please help.

Thanks in advance!

Simon.

Jan 3 '07 #2

If you have code that worked in Java but doesn't work once ported to
C# then it'd be helpful to post the original and ported code
(preferrably trimmed down version specific to the part that doesn't
work).

Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On 3 Jan 2007 01:07:36 -0800, "dusiapapa" <sd*****@gmail.comwrote:
>Hello, all!

I'm faced with next problem.

I have ASP.NET page which takes url-parameters from ColdFusion site.
These parameters are encrypted with ColdFusion Encrypt function and I
can not decrypt them correctly. I tried to translate several code
examples (in java and C++) I had found on the Internet into C# but they
don't work properly.

I believe that I'm not the first one who met such a problem. If anybody
have ideas (or even codes) please help.

Thanks in advance!

Simon.
Jan 3 '07 #3
Hi, John!
Thanks for reply.

But unfortunately this solution doesn't work. Moreover uudecode threw
an exception so I had to change it's code a little:

if (sBuffer.Length % 4 != 0)
{
string stuff = new String(' ', 4 - sBuffer.Length % 4);
sBuffer = String.Concat(sBuffer, stuff);
}

XOR algorithm uses integer key, and the key used on the CF site is
four-digit string (like "1111"). I tried to set corresponding integer
value (1111), but it still didn't work.

Also I've found out that this issue worries not only me:
http://forums.asp.net/thread/222886.aspx

So I still need help.
"""John Timney (MVP) wrote:
"""
According to Macromedia, The ColdFusion Encrypt function uses an XOR-based
algorithm that utilizes a pseudo random 32-bit key based on a seed passed by
the user as a parameter to the function. The resulting data is UUencoded.

You'll need to uudecode the encoded value first
http://www.eggheadcafe.com/printsear...asp?linkid=351

and then XOR it using the key it was encrypted with.
http://www.java2s.com/Code/CSharp/La...deamessage.htm

If you dont have the key - your wasting yuor time.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"dusiapapa" <sd*****@gmail.comwrote in message
news:11*********************@a3g2000cwd.googlegrou ps.com...
Hello, all!

I'm faced with next problem.

I have ASP.NET page which takes url-parameters from ColdFusion site.
These parameters are encrypted with ColdFusion Encrypt function and I
can not decrypt them correctly. I tried to translate several code
examples (in java and C++) I had found on the Internet into C# but they
don't work properly.

I believe that I'm not the first one who met such a problem. If anybody
have ideas (or even codes) please help.

Thanks in advance!

Simon.
Jan 4 '07 #4
Peter, who wrote that article can usually be found lurking in this
newsgroup - you might wish to Ping him by name on the subject line of a post
for some advice.

As an alternative, theres another popular uudecode implementation to try
http://geekswithblogs.net/kobush/articles/63486.aspx

Looking a little deeper as I dont know much about Cold Fusion, I think part
of your problem here may be that it perhaps uses DES encryption or MD5 and
not simple XOR, so until you can work out exactly how CF Encrypt works
you'll struggle to find an approach for decrypting it using another
framework like .net. Theres a fair article on CF encryptiuon here that
might help:
http://coldfusion.sys-con.com/read/172571.htm

Other than that I would suggest trying the dotnet.general newsgroup with
your question and see if anyone there knows more.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"dusiapapa" <sd*****@gmail.comwrote in message
news:11**********************@6g2000cwy.googlegrou ps.com...
Hi, John!
Thanks for reply.

But unfortunately this solution doesn't work. Moreover uudecode threw
an exception so I had to change it's code a little:

if (sBuffer.Length % 4 != 0)
{
string stuff = new String(' ', 4 - sBuffer.Length % 4);
sBuffer = String.Concat(sBuffer, stuff);
}

XOR algorithm uses integer key, and the key used on the CF site is
four-digit string (like "1111"). I tried to set corresponding integer
value (1111), but it still didn't work.

Also I've found out that this issue worries not only me:
http://forums.asp.net/thread/222886.aspx

So I still need help.
"""John Timney (MVP) wrote:
"""
>According to Macromedia, The ColdFusion Encrypt function uses an
XOR-based
algorithm that utilizes a pseudo random 32-bit key based on a seed passed
by
the user as a parameter to the function. The resulting data is UUencoded.

You'll need to uudecode the encoded value first
http://www.eggheadcafe.com/printsear...asp?linkid=351

and then XOR it using the key it was encrypted with.
http://www.java2s.com/Code/CSharp/La...deamessage.htm

If you dont have the key - your wasting yuor time.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"dusiapapa" <sd*****@gmail.comwrote in message
news:11*********************@a3g2000cwd.googlegro ups.com...
Hello, all!

I'm faced with next problem.

I have ASP.NET page which takes url-parameters from ColdFusion site.
These parameters are encrypted with ColdFusion Encrypt function and I
can not decrypt them correctly. I tried to translate several code
examples (in java and C++) I had found on the Internet into C# but they
don't work properly.

I believe that I'm not the first one who met such a problem. If anybody
have ideas (or even codes) please help.

Thanks in advance!

Simon.

Jan 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
4
by: Spikinsson | last post by:
I'm looking for a good decrypt/encrypt function, all I want is a function in this form: char* encrypt(char* normal) { ... return encrypted; } and
8
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
1
by: Microsoft | last post by:
Hi I'm not able to find a newsgroup for classic asp so I'm writing here hoping someone can help me So, I have to encrypt and also decrypt some user passwords I know md5 algoritm is a one way...
0
by: Kelvin | last post by:
Dear all, I don't know how to write a asp/vb/c# program to decrypt PHP encrypted code. Here is attched my code in PHP $key = "ab"; $random_number = kelvin;...
2
by: Miles Keaton | last post by:
still doing my switch from MySQL to PgSQL, and can't figure out what the comparable function would be for this: In MySQL, to store a big secret (like a credit card number) in the database that I...
8
by: toupeira23 | last post by:
Hello, I'm trying to encrypt passwords in my app. After discovering that there's no simple function to do this, I wrote a wrapper class which decodes a string using UTF8, encrypts it with...
4
by: Islamegy® | last post by:
I give up.. I tried everything to encrypt querystring and decrypt it back but this never success.. i use RSA encryption. I always get excption when Convert fromBase64String so i tried...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.