473,699 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4073
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******** *************@a 3g2000cwd.googl egroups.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(s Buffer, 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******** *************@a 3g2000cwd.googl egroups.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.googl egroups.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(s Buffer, 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.goog legroups.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
7953
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 there is a method which can generate a same with the same input string? There is a need to transfer file between to site,and the customer wish to encrypt these files during transfering,and they want to store a string into each database at...
4
28290
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
8173
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, just for a simple Encryption and Decryption function. thanks, Gidi.
1
1609
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 method so it can't be used for decryption Do you know about any ready-made functions (Classical ASP) to do this task? (Encrypt and Decrypt)
0
1774
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; $encrypted=encrypt($key,$random_number); $decrypted=decrypt($key,$encrypted);
2
8267
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 didn't want anyone to be able to see without knowing the salt/password value, I would do this into a blob-type field: INSERT INTO clients(ccnum) VALUES (ENCODE(''433904123121309319', 'xyzzy')); Then it would be stored as binary jumble in the...
8
4275
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 TripleDES and returns a Base64-encoded string. The decryption function does the reverse, i.e. Base64-decodes the string, decrypts it with the same Key and IV, and encodes it again with UTF8. The problem is that after decrypting, the 8th character is...
4
4204
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 HttpUtitlity.UrlEncode() but i got bad data Exception.. Is there anyway to work around this??
3
8287
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 build with these methods, will appear to encrypt and decrypt, but the resulting decrypted file will be corrupted. I tried encrypting a .bmp file and then decrypting, the resulting decrypted file under .NET 2.0 is garbage, the .NET 1.1 build works...
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7745
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.