473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Total confused and need help with small encryption and decryption methods

Hello Everyone,
Long time ago, I posted a small problem I had about converting a VB6
program to C#. Well with the help with everyone I got it converted.
But I overlooked something and don't understand why it is doing this.
Below is my code, I would be greatfull if someone can guide me through
the right path or even help me solve this issue.

Problem: The old tool which was written in VB6 works perfect. But I
needed to convert this to C# using since there are new tools we are
creating that would like to leverage this style of security. The
problem is that the encryption method is not working as it should. The
decryption method works perfect. Just having problems with the
encryption part.

Test Values:
Current Encrypted Value - 0835262B27
Value returned using Decrypt method - anna

Current Decrypted Value - anna
Value returned using Encrypted method - 35262B27

*** As you can see the encryption method is returning something
different then the original encrypted value. *** PLEASE HELP !!! ***

CODE:

static byte[] ParseHex(string text)
{
byte[] ret = new byte[text.Length / 2];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = Convert.ToByte( text.Substring( i * 2, 2), 16);
}
return ret;
}

public static string Decrypt("THEFEL DGROUP", string encrypted)
{
byte[] binary = ParseHex(encryp ted);
char[] chars = new char[binary.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char)(binary[i] ^ password[i % password.Length]);
}
return new string(chars);
}
public static string Encrypt("THEFEL DGROUP", string
strG)
{
char[] cHexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};

// the encoded integer value of the current character in the string
byte byteEncoded;

System.Text.Str ingBuilder sbReturned = new
System.Text.Str ingBuilder();

for (int i = 0; i < strG.Length; ++i)
{
// encode the current character
byteEncoded = (byte)(((int)st rG[i]) ^ ((int)strPass[i %
strPass.Length]));

// output the Hex character value of the above encoded value
sbReturned.Appe nd(cHexDigits[byteEncoded >>
4]).Append(cHexDi gits[byteEncoded & 0xF]);
}

return sbReturned.ToSt ring();
}

Apr 3 '07 #1
8 2743
On 3 Apr, 18:18, manmit.wa...@gm ail.com wrote:
Hello Everyone,
Long time ago, I posted a small problem I had about converting a VB6
program to C#. Well with the help with everyone I got it converted.
But I overlooked something and don't understand why it is doing this.
Below is my code, I would be greatfull if someone can guide me through
the right path or even help me solve this issue.

Problem: The old tool which was written in VB6 works perfect. But I
needed to convert this to C# using since there are new tools we are
creating that would like to leverage this style of security. The
problem is that the encryption method is not working as it should. The
decryption method works perfect. Just having problems with the
encryption part.

Test Values:
Current Encrypted Value - 0835262B27
Value returned using Decrypt method - anna

Current Decrypted Value - anna
Value returned using Encrypted method - 35262B27

*** As you can see the encryption method is returning something
different then the original encrypted value. *** PLEASE HELP !!! ***

CODE:

static byte[] ParseHex(string text)
{
byte[] ret = new byte[text.Length / 2];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = Convert.ToByte( text.Substring( i * 2, 2), 16);
}
return ret;
}

public static string Decrypt("THEFEL DGROUP", string encrypted)
{
byte[] binary = ParseHex(encryp ted);
char[] chars = new char[binary.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char)(binary[i] ^ password[i % password.Length]);
}
return new string(chars);
}

public static string Encrypt("THEFEL DGROUP", string
strG)
{
char[] cHexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};

// the encoded integer value of the current character in the string
byte byteEncoded;

System.Text.Str ingBuilder sbReturned = new
System.Text.Str ingBuilder();

for (int i = 0; i < strG.Length; ++i)
{
// encode the current character
byteEncoded = (byte)(((int)st rG[i]) ^ ((int)strPass[i %
strPass.Length]));

// output the Hex character value of the above encoded value
sbReturned.Appe nd(cHexDigits[byteEncoded >>
4]).Append(cHexDi gits[byteEncoded & 0xF]);
}

return sbReturned.ToSt ring();
}

Hi, I've had to tweak it a bit, and it seems you've posted the
password used to encrypt decrypt, although I couldn't have got the
same results without it :) Interestingly I get the second version
regardless of whether I decrypt or encrypt, and decrypting 0835262B27
gives me the completely wrong result. I.e. not anna

Can you confirm that you actually want 0835262B27 and not 35262B27?
The second seems correct to me as it's 4 bytes which I would expect as
anna is four chars long.

Now if the 08 is required that would convert to ascii bell(?) That's
assuming the text is encoded as ascii, I've not used much of the
encoding stuff as I have a small world view, so can't comment on
whether that would cause you issues or any other problems for that
matter.

Hope that helps

Apr 3 '07 #2
On Apr 3, 2:55 pm, "DeveloperX " <nntp...@operam ail.comwrote:
On 3 Apr, 18:18, manmit.wa...@gm ail.com wrote:


Hello Everyone,
Long time ago, I posted a small problem I had about converting a VB6
program to C#. Well with the help with everyone I got it converted.
But I overlooked something and don't understand why it is doing this.
Below is my code, I would be greatfull if someone can guide me through
the right path or even help me solve this issue.
Problem: The old tool which was written in VB6 works perfect. But I
needed to convert this to C# using since there are new tools we are
creating that would like to leverage this style of security. The
problem is that the encryption method is not working as it should. The
decryption method works perfect. Just having problems with the
encryption part.
Test Values:
Current Encrypted Value - 0835262B27
Value returned using Decrypt method - anna
Current Decrypted Value - anna
Value returned using Encrypted method - 35262B27
*** As you can see the encryption method is returning something
different then the original encrypted value. *** PLEASE HELP !!! ***
CODE:
static byte[] ParseHex(string text)
{
byte[] ret = new byte[text.Length / 2];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = Convert.ToByte( text.Substring( i * 2, 2), 16);
}
return ret;
}
public static string Decrypt("THEFEL DGROUP", string encrypted)
{
byte[] binary = ParseHex(encryp ted);
char[] chars = new char[binary.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char)(binary[i] ^ password[i % password.Length]);
}
return new string(chars);
}
public static string Encrypt("THEFEL DGROUP", string
strG)
{
char[] cHexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
// the encoded integer value of the current character in the string
byte byteEncoded;
System.Text.Str ingBuilder sbReturned = new
System.Text.Str ingBuilder();
for (int i = 0; i < strG.Length; ++i)
{
// encode the current character
byteEncoded = (byte)(((int)st rG[i]) ^ ((int)strPass[i %
strPass.Length]));
// output the Hex character value of the above encoded value
sbReturned.Appe nd(cHexDigits[byteEncoded >>
4]).Append(cHexDi gits[byteEncoded & 0xF]);
}
return sbReturned.ToSt ring();
}

Hi, I've had to tweak it a bit, and it seems you've posted the
password used to encrypt decrypt, although I couldn't have got the
same results without it :) Interestingly I get the second version
regardless of whether I decrypt or encrypt, and decrypting 0835262B27
gives me the completely wrong result. I.e. not anna

Can you confirm that you actually want 0835262B27 and not 35262B27?
The second seems correct to me as it's 4 bytes which I would expect as
anna is four chars long.

Now if the 08 is required that would convert to ascii bell(?) That's
assuming the text is encoded as ascii, I've not used much of the
encoding stuff as I have a small world view, so can't comment on
whether that would cause you issues or any other problems for that
matter.

Hope that helps- Hide quoted text -

- Show quoted text -
Hello,
I am actually looking for the outcome to be 0835262B27 but I am
getting 35262B27. So you are right, that it is missing '08' but I
don't know why it is missing that variable.

Thanks

Apr 3 '07 #3
On 3 Apr 2007 10:18:00 -0700, ma**********@gm ail.com wrote:
>Hello Everyone,
Long time ago, I posted a small problem I had about converting a VB6
program to C#. Well with the help with everyone I got it converted.
But I overlooked something and don't understand why it is doing this.
Below is my code, I would be greatfull if someone can guide me through
the right path or even help me solve this issue.

Problem: The old tool which was written in VB6 works perfect. But I
needed to convert this to C# using since there are new tools we are
creating that would like to leverage this style of security. The
problem is that the encryption method is not working as it should. The
decryption method works perfect. Just having problems with the
encryption part.

Test Values:
Current Encrypted Value - 0835262B27
Value returned using Decrypt method - anna

Current Decrypted Value - anna
Value returned using Encrypted method - 35262B27

*** As you can see the encryption method is returning something
different then the original encrypted value. *** PLEASE HELP !!! ***

CODE:

static byte[] ParseHex(string text)
{
byte[] ret = new byte[text.Length / 2];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = Convert.ToByte( text.Substring( i * 2, 2), 16);
}
return ret;
}

public static string Decrypt("THEFEL DGROUP", string encrypted)
This line does not compile. You probably should have written
something like:
public static string Decrypt(string password, string encrypted)

> {
byte[] binary = ParseHex(encryp ted);
char[] chars = new char[binary.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char)(binary[i] ^ password[i % password.Length]);
}
return new string(chars);
}

public static string Encrypt("THEFEL DGROUP", string strG)
Again this line does not compile:
public static string Encrypt(string strPass, string strG)
> {
char[] cHexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};

// the encoded integer value of the current character in the string
byte byteEncoded;

System.Text.Str ingBuilder sbReturned = new
System.Text.St ringBuilder();

for (int i = 0; i < strG.Length; ++i)
{
// encode the current character
byteEncoded = (byte)(((int)st rG[i]) ^ ((int)strPass[i %
strPass.Leng th]));

// output the Hex character value of the above encoded value
sbReturned.Appe nd(cHexDigits[byteEncoded >>
4]).Append(cHexDi gits[byteEncoded & 0xF]);
}

return sbReturned.ToSt ring();
}
Your code does not have the "08" because you are encoding a four
character plaintext into a four byte (= 8 hex digits) cyphertext. I
suggest you have a close look at the VB original to see where the
initial "08" comes from, then you need to reproduce that in your C#
version. We do not have enough information here to see its origin.

Your encryption scheme, a stream cypher with a repeating key, is not
very secure. Good enough to deter casual observation but easily
breakable by anyone seriously interested. Repeating any part of the
keystream is a big weakness for any stream cypher.

rossum

Apr 3 '07 #4
I agree. It's better to use more secure methods such as
System.Security .Cryptography. There is little space here to explain in
detail, but I can give you an example if you want.

Freiddie
http://fei.yuanbw.googlepages.com/
http://freiddy.blogspot.com/
http://crazibe.blogspot.com/

Apr 3 '07 #5
On 3 Apr, 21:06, rossum <rossu...@coldm ail.comwrote:
On 3 Apr 2007 10:18:00 -0700, manmit.wa...@gm ail.com wrote:
Hello Everyone,
Long time ago, I posted a small problem I had about converting a VB6
program to C#. Well with the help with everyone I got it converted.
But I overlooked something and don't understand why it is doing this.
Below is my code, I would be greatfull if someone can guide me through
the right path or even help me solve this issue.
Problem: The old tool which was written in VB6 works perfect. But I
needed to convert this to C# using since there are new tools we are
creating that would like to leverage this style of security. The
problem is that the encryption method is not working as it should. The
decryption method works perfect. Just having problems with the
encryption part.
Test Values:
Current Encrypted Value - 0835262B27
Value returned using Decrypt method - anna
Current Decrypted Value - anna
Value returned using Encrypted method - 35262B27
*** As you can see the encryption method is returning something
different then the original encrypted value. *** PLEASE HELP !!! ***
CODE:
static byte[] ParseHex(string text)
{
byte[] ret = new byte[text.Length / 2];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = Convert.ToByte( text.Substring( i * 2, 2), 16);
}
return ret;
}
public static string Decrypt("THEFEL DGROUP", string encrypted)

This line does not compile. You probably should have written
something like:
public static string Decrypt(string password, string encrypted)
{
byte[] binary = ParseHex(encryp ted);
char[] chars = new char[binary.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char)(binary[i] ^ password[i % password.Length]);
}
return new string(chars);
}
public static string Encrypt("THEFEL DGROUP", string strG)

Again this line does not compile:
public static string Encrypt(string strPass, string strG)
{
char[] cHexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
// the encoded integer value of the current character in the string
byte byteEncoded;
System.Text.Str ingBuilder sbReturned = new
System.Text.Str ingBuilder();
for (int i = 0; i < strG.Length; ++i)
{
// encode the current character
byteEncoded = (byte)(((int)st rG[i]) ^ ((int)strPass[i %
strPass.Length]));
// output the Hex character value of the above encoded value
sbReturned.Appe nd(cHexDigits[byteEncoded >>
4]).Append(cHexDi gits[byteEncoded & 0xF]);
}
return sbReturned.ToSt ring();
}

Your code does not have the "08" because you are encoding a four
character plaintext into a four byte (= 8 hex digits) cyphertext. I
suggest you have a close look at the VB original to see where the
initial "08" comes from, then you need to reproduce that in your C#
version. We do not have enough information here to see its origin.

Your encryption scheme, a stream cypher with a repeating key, is not
very secure. Good enough to deter casual observation but easily
breakable by anyone seriously interested. Repeating any part of the
keystream is a big weakness for any stream cypher.

rossum
This is the version I tweaked. Also be aware there were some broken
lines which I imagine will reappear. Manmit, can you post a link to
the original code or the original VB6 code? I still reckon it's
working as intended, the 08 isn't a bell, I misread the original
code. Can you try with your working code (the vb6 one I guess) and
see if it is always 08? You may have a bug in the VB6 that just
happens to have been obfuscated because it's consistent between
encrypt and decrypt.. Oops, just read the end of Rossum's post and
he's said everything I was about to :)
If you need backwards compatability with existing data, I'd consider
decrypting with your algorithm and then re-encrypting it with
something stronger. The enterprise library has a good encryption
block. You could knock up a batch decrypter in VB6 with the working
code, then a batch re-encrypter in dotnet. Back up your data first ;)
class Program
{
static void Main(string[] args)
{
Console.WriteLi ne(Encrypt("ann a"));
Console.WriteLi ne(Decrypt("352 62B27"));
//SocketTest t = new SocketTest();
//t.Connect("www. wu2.co.uk", 80);
}
static byte[] ParseHex(string text)
{
byte[] ret = new byte[text.Length / 2];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = Convert.ToByte( text.Substring( i * 2,
2), 16);
}
return ret;
}

public static string Decrypt(string encrypted)
{
string password = "THEFELDGRO UP";
byte[] binary = ParseHex(encryp ted);
char[] chars = new char[binary.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char)(binary[i] ^ password[i %
password.Length]);
}
return new string(chars);
}

public static string Encrypt(string strG)
{
string strPass = "THEFELDGRO UP";
char[] cHexDigits = {
'0', '1', '2', '3', '4', '5', '6',
'7',
'8', '9', 'A', 'B', 'C', 'D', 'E',
'F'
};

// the encoded integer value of the current character in
the string
byte byteEncoded;

System.Text.Str ingBuilder sbReturned = new
System.Text.Str ingBuilder();

for (int i = 0; i < strG.Length; ++i)
{
// encode the current character
byteEncoded = (byte)(((int)st rG[i]) ^
((int)strPass[i % strPass.Length]));

// output the Hex character value of the above
encoded value
sbReturned.Appe nd(cHexDigits[byteEncoded >>
4]).Append(cHexDi gits[byteEncoded & 0xF]);
}

return sbReturned.ToSt ring();
}
}
Apr 3 '07 #6
On Apr 3, 4:21 pm, "Freiddie" <fei.yua...@gma il.comwrote:
I agree. It's better to use more secure methods such as
System.Security .Cryptography. There is little space here to explain in
detail, but I can give you an example if you want.

Freiddiehttp://fei.yuanbw.goog lepages.com/http://freiddy.blogspo t.com/http://crazibe.blogspo t.com/
I would have used the Cryptography class in .NET but as I said the
current cryptology that is being used was written in VB6 or so. And I
can not change the way the text is encrypted or decrypted becuase
there are applications written using the exisiting code. All I am
charge to do is convert it to an C# dll file so that future apps can
use the .NET version rather then the vb version.

Here is the original VB. version

Attribute VB_Name = "Module1"
Option Explicit
Dim pass$
Dim Strg$
Function decrypt(ByVal H$) As String
Dim i As Integer, J$
pass$ = "THEFELDGRO UP"
'H$ = the buffered encrypted data
H$ = Mid$(H$, 3, Val(Left$(H$, 2)))
' debuffer it
Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next
'Strg$ now contains the encrypted string, which you can now
'decrypt.
Call Crypt(pass$, Strg$)
'strg$ now is decrypted
decrypt = Strg$
End Function
Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer
a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1)): a = a + 1: If a Len(pass$) Then a
=
1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
Next
End Function

Apr 3 '07 #7
On 3 Apr 2007 14:11:00 -0700, ma**********@gm ail.com wrote:
>On Apr 3, 4:21 pm, "Freiddie" <fei.yua...@gma il.comwrote:
>I agree. It's better to use more secure methods such as
System.Securit y.Cryptography. There is little space here to explain in
detail, but I can give you an example if you want.

Freiddiehttp ://fei.yuanbw.goog lepages.com/http://freiddy.blogspo t.com/http://crazibe.blogspo t.com/

I would have used the Cryptography class in .NET but as I said the
current cryptology that is being used was written in VB6 or so. And I
can not change the way the text is encrypted or decrypted becuase
there are applications written using the exisiting code. All I am
charge to do is convert it to an C# dll file so that future apps can
use the .NET version rather then the vb version.

Here is the original VB. version

Attribute VB_Name = "Module1"
Option Explicit
Dim pass$
Dim Strg$
Function decrypt(ByVal H$) As String
Dim i As Integer, J$
pass$ = "THEFELDGRO UP"
If you were using a stronger encryption, holding the key in plaintext
would be a weakness; but with your encryption scheme it does not make
the attacker's job that much easier.
>
' H$ = the buffered encrypted data
H$ = Mid$(H$, 3, Val(Left$(H$, 2)))
This is where your problem is. It is chopping off the first two
characters of the H$ parameter string, "Left$(H$, 2)", your extra
"08", and using them "Val(Left$( H$, 2))" to determine the length of
text to extract and decode: H$ = Mid$(H$, 3, Val("08"))
The first two characters appear to represent the length in decimal of
the following cyphertext.

You need to amend your C# Decrypt function to account for these two
characters:
Parse the first two characters as a decimal number.
Truncate the remaining cyphertext to that length
Decypher the truncated cyphertext

You also need to add these two characters to the start of any
encrypted string after you have converted it to Hex digits. Best to
check the VB original to see if there are any other things done that I
cannot determine here. For instance, what happens if the cyphertext
is more than 99 hex digits long?

rossum
>
' debuffer it
Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next

'Strg$ now contains the encrypted string, which you can now
'decrypt.

Call Crypt(pass$, Strg$)

'strg$ now is decrypted
decrypt = Strg$
End Function
Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer
a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1))
a = a + 1
If a Len(pass$) Then a = 1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
Next
End Function

Apr 3 '07 #8
On Apr 3, 6:36 pm, rossum <rossu...@coldm ail.comwrote:
On 3 Apr 2007 14:11:00 -0700, manmit.wa...@gm ail.com wrote:


On Apr 3, 4:21 pm, "Freiddie" <fei.yua...@gma il.comwrote:
I agree. It's better to use more secure methods such as
System.Security .Cryptography. There is little space here to explain in
detail, but I can give you an example if you want.
Freiddiehttp://fei.yuanbw.goog lepages.com/http://freiddy.blogspo t.com/http://...
I would have used the Cryptography class in .NET but as I said the
current cryptology that is being used was written in VB6 or so. And I
can not change the way the text is encrypted or decrypted becuase
there are applications written using the exisiting code. All I am
charge to do is convert it to an C# dll file so that future apps can
use the .NET version rather then the vb version.
Here is the original VB. version
Attribute VB_Name = "Module1"
Option Explicit
Dim pass$
Dim Strg$
Function decrypt(ByVal H$) As String
Dim i As Integer, J$
pass$ = "THEFELDGRO UP"

If you were using a stronger encryption, holding the key in plaintext
would be a weakness; but with your encryption scheme it does not make
the attacker's job that much easier.
' H$ = the buffered encrypted data
H$ = Mid$(H$, 3, Val(Left$(H$, 2)))

This is where your problem is. It is chopping off the first two
characters of the H$ parameter string, "Left$(H$, 2)", your extra
"08", and using them "Val(Left$( H$, 2))" to determine the length of
text to extract and decode: H$ = Mid$(H$, 3, Val("08"))
The first two characters appear to represent the length in decimal of
the following cyphertext.

You need to amend your C# Decrypt function to account for these two
characters:
Parse the first two characters as a decimal number.
Truncate the remaining cyphertext to that length
Decypher the truncated cyphertext

You also need to add these two characters to the start of any
encrypted string after you have converted it to Hex digits. Best to
check the VB original to see if there are any other things done that I
cannot determine here. For instance, what happens if the cyphertext
is more than 99 hex digits long?

rossum


' debuffer it
Strg$ = ""
For i = 1 To Len(H$) Step 2
J$ = Mid$(H$, i, 2)
Strg$ = Strg$ + Chr$(Val("&H" + J$))
Next
'Strg$ now contains the encrypted string, which you can now
'decrypt.
Call Crypt(pass$, Strg$)
'strg$ now is decrypted
decrypt = Strg$
End Function
Function Crypt(pass$, Strg$)
Dim a, b
Dim i As Integer
a = 1
For i = 1 To Len(Strg$)
b = Asc(Mid$(pass$, a, 1))
a = a + 1
If a Len(pass$) Then a = 1
Mid$(Strg$, i, 1) = Chr$(Asc(Mid$(S trg$, i, 1)) Xor b)
Next
End Function- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
Thanks Rossum, I think I got the idea. Basically the first two
characters that are missing is a numerical value of the length of the
encrypted string. This should work. Let me try it and will keep you
updated.
Thanks again for the help.

Apr 4 '07 #9

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

Similar topics

1
2423
by: D. Alvarado | last post by:
On my Fedora Core 2 Linux dev box, I have installed mcrypt and compiled PHP with the --with-mcrypt option. I am concerned that when I move to another hosting enviornment mcrypt will not be supported. In people's experiences, have hosting companies supporting PHP/MySQL generally provided support for mcrypt? Does anyone recommend another module for encryption/decryption that accompanies the PHP package? Thanks, - Dave
1
2470
by: Jase H | last post by:
Hello, I have a ASP.NET web application problem involving the data encryption and decryption assembly(DLL) used on the connection string value that is set in the webconfig file. The problem occurs in the application when you instantiate a new instance of the class as shown below: ---Dim dp As DPAPIComp.DataProtectorComp = New DPAPIComp.DataProtectorComp--- where DPAPIComp is the name of the namespace referenced to in the library
3
2305
by: Mike | last post by:
Hi, I have been experimenting with the RijndaelManaged Cryptography class in C# and have stumbled upon a "peculiarity". Following code is standalone Console App that demonstrates using System; using System.Text; using System.IO;
2
7151
by: almurph | last post by:
Hi everyone, Can you help me please? I am having a problem with the encryption/decryption of words with the Irish fada in them. The Irish fada is like this: áéíóú/ÁÉÍÓÚ. It's kind of like the French grave... Anyway when I run encryption on a plaintext word like:
2
2432
by: tfoxusenet | last post by:
Hi, I need to encrypt/decrypt some data for my C# application that can also be read on a unix system, and need a quick, simple, cross-platform solution I can embed in my own code that doesn't require dependencies on outside applications. I don't know much about encryption. What I would like to do is come up with an encryption/decryption code that will work with my C#/.NET framework windows code (there are a number of cryptographic...
3
3972
by: Mythran | last post by:
I have googled and tested and tried and still I can't seem to implement a simple encryption/decryption console application. My goal is to create two methods. public byte Encrypt(string DataToEncrypt, string Key) { ... } public byte Decrypt(byte DataToDecrypt, string Key)
1
2402
by: ppuniversal | last post by:
Hello, I am making a DES encryption/decryption program using OpenSSL library. I am using function des_ecb_encrypt(des_cblock *input, des_cblock *output, des_cblock *keysched, int mode); This function can encrypt/decrypt only 8bytes block at a time. Thus takes a lot of time during encryption/decryption. Please tell, if there is any other way/function that can take larger block size, or any other function which implements DES in a...
0
2372
by: Dipanwita | last post by:
I have written a RSA encryption/decryption function in c using the formula a = b^c %n. For solving the equation I have used Squaring and multiplying method for modulo exponentiation . These functions work fine when Two random prime numbers (required to generate public n private key) are within certain range but fails afterwords.All the variables are of datatype ULONGLONG. I m unable to fix up the problem. Is these really a storage problem...
3
3072
by: =?Utf-8?B?TG9yZW4=?= | last post by:
I’m trying to encrypt and decrypt a file in vb.net. I am using the TripleDESCryptoServiceProvider encryption found in System.Security.Cryptography. Below is the code for my Encrypt and Decrypt functions. While my functions read and write files the encryption/decryption is not working properly. My test file has an original length of 66,048 bytes. My encrypted file ends up with 66,056 bytes … 8 bytes more than my original. When I...
0
8987
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
8826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9366
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
8239
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
6793
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
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
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...
3
2211
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.