473,414 Members | 1,772 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,414 software developers and data experts.

Encrypted Strings

Hello,

I'm building a web application where I need to have some post data
encrypted. An example would be something like this:
<input type=hidden value='<%# GetEncriptedData() %>'>

GetEncryptedData() returns a string value that I can post.

I will be using a symmetric algorithm; most likely the Rijndael algorithm.
I don't have any problem encrypting my data but the issue lies in the fact
that I am left with the encrypted data in a byte array (byte[]). I believe
I need to somehow convert this to a string format and then run it through
the Server.URLEncode() method so that the string is then postable.

I will also need to convert it back to bytes. Obviously using
Server.URLDecode() and then some other method.

Any help would be greatly appreciated!

David Kyle
www.chloemag.com

Nov 18 '05 #1
2 1179
You will need to use the ToBase64String() method. This is because the
encrypted data will contain binary data which can not be put in to a string
object.

BYTEARRAY = EncryptData()
STRING = System.Convert.ToBase64String(BYTEARRAY)

<input type=hidden name=data value='<%# Server.UrlEncode(STRING ) %>'>

Then before decoding use

STRING = Server.URLDecode(Request("data"))
BYTEARRAY = System.Convert.FromBase64String(STRING )
DecryptData(BYTEARRAY)

Bill

"David Kyle" <dk***@chloemag.com> wrote in message
news:Of**************@TK2MSFTNGP15.phx.gbl...
Hello,

I'm building a web application where I need to have some post data
encrypted. An example would be something like this:
<input type=hidden value='<%# GetEncriptedData() %>'>

GetEncryptedData() returns a string value that I can post.

I will be using a symmetric algorithm; most likely the Rijndael algorithm.
I don't have any problem encrypting my data but the issue lies in the fact
that I am left with the encrypted data in a byte array (byte[]). I
believe I need to somehow convert this to a string format and then run it
through the Server.URLEncode() method so that the string is then postable.

I will also need to convert it back to bytes. Obviously using
Server.URLDecode() and then some other method.

Any help would be greatly appreciated!

David Kyle
www.chloemag.com

Nov 18 '05 #2
My God! Your a god sent Bill! Thanks so much for the help. It works
wonderfully!

Cheers!

David Kyle
www.chloemag.com

"Bill" <ms****@hotmail.com> wrote in message
news:ul**************@TK2MSFTNGP11.phx.gbl...
You will need to use the ToBase64String() method. This is because the
encrypted data will contain binary data which can not be put in to a
string object.

BYTEARRAY = EncryptData()
STRING = System.Convert.ToBase64String(BYTEARRAY)

<input type=hidden name=data value='<%# Server.UrlEncode(STRING ) %>'>

Then before decoding use

STRING = Server.URLDecode(Request("data"))
BYTEARRAY = System.Convert.FromBase64String(STRING )
DecryptData(BYTEARRAY)

Bill

"David Kyle" <dk***@chloemag.com> wrote in message
news:Of**************@TK2MSFTNGP15.phx.gbl...
Hello,

I'm building a web application where I need to have some post data
encrypted. An example would be something like this:
<input type=hidden value='<%# GetEncriptedData() %>'>

GetEncryptedData() returns a string value that I can post.

I will be using a symmetric algorithm; most likely the Rijndael
algorithm. I don't have any problem encrypting my data but the issue lies
in the fact that I am left with the encrypted data in a byte array
(byte[]). I believe I need to somehow convert this to a string format
and then run it through the Server.URLEncode() method so that the string
is then postable.

I will also need to convert it back to bytes. Obviously using
Server.URLDecode() and then some other method.

Any help would be greatly appreciated!

David Kyle
www.chloemag.com


Nov 18 '05 #3

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

Similar topics

5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
1
by: Sathyaish | last post by:
I have the following scenario: Algorithm: 3DES Cipher Mode: CBC Key Size: 128-bit Block Size: 64 bit IV: 0x0000000000000000 (an eight byte array of zeros) The results I get using .NET with...
5
by: Ranginald | last post by:
Hi, I have a question about encrypting connection strings in an asp.net 2.0 app in a shared hosting environment. From what I have read, I believe I need to programatically encrypt and decrypt...
0
by: danishce | last post by:
I want to generate 8 byte key using CBC MAC by applying encryption to whole message in vb.net.My code is: //Main form Code Imports System.Security.Cryptography Dim plainText As String ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.