Re: Encrytion causing error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The function is a webservice. I am passing the encrypted text as a string. I
am assuming it can't convert it to XML.

"Grant Merwitz" <grant@xxxxxxxxxxxxx> wrote in message
news:OiSP7kcmFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
> Try enclose the encrypted data in CDATA tags
>
> <SomeNode>
> <![CDATA[
> encrypted data with invalid characters go here
> ]]>
> </SomeNode>
>
> "Chris Kennedy" <chrisknospam@xxxxxxxxxxxx> wrote in message
> news:esSd2ccmFHA.2484@xxxxxxxxxxxxxxxxxxxxxxx
>>I am encryted some data for use in calling an xml function
>>
>> System.Xml.XmlException:'', hexadecimal value 0x13, is an invalid
>> character.
>>
>> Here is my encryption function.
>>
>> Function Encrypt(ByVal value As String) As String
>> Dim cryptoProvider As DESCryptoServiceProvider = New
>> DESCryptoServiceProvider()
>> Dim ms As MemoryStream = New MemoryStream()
>> Dim cs As CryptoStream = New CryptoStream(ms,
>> cryptoProvider.CreateEncryptor(key_64, IV_64), CryptoStreamMode.Write)
>> Dim sw As StreamWriter = New StreamWriter(cs)
>> sw.Write(value)
>> sw.Flush()
>> cs.FlushFinalBlock()
>> ms.Flush()
>> Return Convert.ToBase64String(ms.GetBuffer(), 0, ms.Length)
>> End Function
>>
>> Any ideas of how pass encrypted data as XML without XML illegal character
>> errors.
>>
>
>


.



Relevant Pages

  • RE: RSA Encryption: Saving keys as files, and size of encrypted data
    ... private static void GenerateKeys(string pubFile, ... // Write the public and private key in files. ... The asymmetric encryption is not suitable for the encryption of large ... key as an xml string. ...
    (microsoft.public.dotnet.security)
  • Re: Encrytion causing error
    ... Not sure if an encrypted over Xml through a web service would break it. ... Just a thought - as web services are http based, maybe the encryption it ... Maybe give UrlEncoding the string a try. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Encrytion causing error
    ... Try enclose the encrypted data in CDATA tags ... > Function Encrypt(ByVal value As String) As String ... > Any ideas of how pass encrypted data as XML without XML illegal character ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Whats wrong with my encryption function?
    ... key is then used to do the actual encryption. ... session key, the random data used in key creation is stored in the encrypted ... explains why the encrypted data is different even if the original clear ... return the same string. ...
    (microsoft.public.dotnet.security)
  • Re: TripleDES output size
    ... I'm new to cryptography and I've to implement encryption of data into ... the encrypted string based on the length of the plain string. ... As I've to store the encrypted data into table fields, ...
    (microsoft.public.dotnet.security)