473,386 Members | 1,812 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.

Encryption/Decryption Changes File Size

Version: VS 2005

I took the sample code from help about encrypting and decrypting
strings, and changed it to work directly with byte arrays and get the
key and IV values from functions I've written to privide them. No
other changes were made...

Friend Function EncryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a MemoryStream.
Dim mStream As New MemoryStream

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim cStream As New CryptoStream(mStream, New
TripleDESCryptoServiceProvider().CreateEncryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write)

' Write the byte array to the crypto stream and flush it.
cStream.Write(Data, 0, Data.Length)
cStream.FlushFinalBlock()

' Get an array of bytes from the
' MemoryStream that holds the
' encrypted data.
Dim ret As Byte() = mStream.ToArray()

' Close the streams.
cStream.Close()
mStream.Close()

' Return the encrypted buffer.
Return ret
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Read)

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length)

'Convert the buffer into a string and return it.
Return fromEncrypt
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

When I encrypt and decrypt a file, the file ends up with extra blank
bytes on the end of it. My encrypt/decrypt routine is as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim fin As New FileStream("test.jpg", FileMode.Open)
Dim mugshot(fin.Length) As Byte
fin.Read(mugshot, 0, fin.Length)
fin.Close()
MessageBox.Show(mugshot.Length)

Dim encrypted() As Byte
encrypted = EncryptBytes(mugshot, "This is a test...")
MessageBox.Show(encrypted.Length)

Dim decrypted() As Byte
decrypted = DecryptBytes(encrypted, "This is a test...")
MessageBox.Show(decrypted.Length)

Dim fout As New FileStream("testout.jpg", FileMode.Create)
fout.Write(decrypted, 0, decrypted.Length)
fout.Close()
End Sub

This doesn't seem to bother the jpeg files...they read just fine. But
what if it WASN'T a jpeg? Is it the encrypt/decrypt routine or the
file IO stuff that's adding the extra bytes?

Any help appreciated.

Nov 21 '05 #1
4 2488
The following line sets fromEncypt to the same size as data length (actually
data length + 1)
so you have 9 extra (0) bytes at the end. I think the 8 bytes are the
encryption key.

' Create buffer to hold the decrypted data.

Dim fromEncrypt(Data.Length ) As Byte

you could do this:

' Create buffer to hold the decrypted data.

Dim fromEncrypt(Data.Length - 9) As Byte

or

I think the right way is something like this (NOTE: in DecryptBytes that
"CryptoStreamMode.Write" is Write NOT Read - This is NOT a mistype, it needs
to be this way, the same is true for csDecrypt.Write, then change Return to
msDecrypt.ToArray , you will also be writing directly from Data, no need for
fromEncrypt) . For more information on this go to:

http://blogs.gotdotnet.com/ivanmed/P...6-5973106935a4

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write) <=== Changed this line

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Write(Data, 0, Data.Length -1) <=== Changed this line

'Convert the buffer into a string and return it.
Return msDecrypt.ToArray <==== Changed this line.
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function
"Phillip Ian" <ph****@comcast.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Version: VS 2005

I took the sample code from help about encrypting and decrypting
strings, and changed it to work directly with byte arrays and get the
key and IV values from functions I've written to privide them. No
other changes were made...

Friend Function EncryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a MemoryStream.
Dim mStream As New MemoryStream

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim cStream As New CryptoStream(mStream, New
TripleDESCryptoServiceProvider().CreateEncryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write)

' Write the byte array to the crypto stream and flush it.
cStream.Write(Data, 0, Data.Length)
cStream.FlushFinalBlock()

' Get an array of bytes from the
' MemoryStream that holds the
' encrypted data.
Dim ret As Byte() = mStream.ToArray()

' Close the streams.
cStream.Close()
mStream.Close()

' Return the encrypted buffer.
Return ret
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Read)

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length)

'Convert the buffer into a string and return it.
Return fromEncrypt
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

When I encrypt and decrypt a file, the file ends up with extra blank
bytes on the end of it. My encrypt/decrypt routine is as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim fin As New FileStream("test.jpg", FileMode.Open)
Dim mugshot(fin.Length) As Byte
fin.Read(mugshot, 0, fin.Length)
fin.Close()
MessageBox.Show(mugshot.Length)

Dim encrypted() As Byte
encrypted = EncryptBytes(mugshot, "This is a test...")
MessageBox.Show(encrypted.Length)

Dim decrypted() As Byte
decrypted = DecryptBytes(encrypted, "This is a test...")
MessageBox.Show(decrypted.Length)

Dim fout As New FileStream("testout.jpg", FileMode.Create)
fout.Write(decrypted, 0, decrypted.Length)
fout.Close()
End Sub

This doesn't seem to bother the jpeg files...they read just fine. But
what if it WASN'T a jpeg? Is it the encrypt/decrypt routine or the
file IO stuff that's adding the extra bytes?

Any help appreciated.

Nov 21 '05 #2
The following line sets fromEncypt to the same size as data length (actually
data length + 1)
so you have 9 extra (0) bytes at the end. I think the 8 bytes are the
encryption key.

' Create buffer to hold the decrypted data.

Dim fromEncrypt(Data.Length ) As Byte

you could do this:

' Create buffer to hold the decrypted data.

Dim fromEncrypt(Data.Length - 9) As Byte

or

I think the right way is something like this (NOTE: in DecryptBytes that
"CryptoStreamMode.Write" is Write NOT Read - This is NOT a mistype, it needs
to be this way, the same is true for csDecrypt.Write, then change Return to
msDecrypt.ToArray , you will also be writing directly from Data, no need for
fromEncrypt) . For more information on this go to:

http://blogs.gotdotnet.com/ivanmed/P...6-5973106935a4

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write) <=== Changed this line

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Write(Data, 0, Data.Length -1) <=== Changed this line

'Convert the buffer into a string and return it.
Return msDecrypt.ToArray <==== Changed this line.
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function
"Phillip Ian" <ph****@comcast.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Version: VS 2005

I took the sample code from help about encrypting and decrypting
strings, and changed it to work directly with byte arrays and get the
key and IV values from functions I've written to privide them. No
other changes were made...

Friend Function EncryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a MemoryStream.
Dim mStream As New MemoryStream

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim cStream As New CryptoStream(mStream, New
TripleDESCryptoServiceProvider().CreateEncryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write)

' Write the byte array to the crypto stream and flush it.
cStream.Write(Data, 0, Data.Length)
cStream.FlushFinalBlock()

' Get an array of bytes from the
' MemoryStream that holds the
' encrypted data.
Dim ret As Byte() = mStream.ToArray()

' Close the streams.
cStream.Close()
mStream.Close()

' Return the encrypted buffer.
Return ret
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Read)

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length)

'Convert the buffer into a string and return it.
Return fromEncrypt
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

When I encrypt and decrypt a file, the file ends up with extra blank
bytes on the end of it. My encrypt/decrypt routine is as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim fin As New FileStream("test.jpg", FileMode.Open)
Dim mugshot(fin.Length) As Byte
fin.Read(mugshot, 0, fin.Length)
fin.Close()
MessageBox.Show(mugshot.Length)

Dim encrypted() As Byte
encrypted = EncryptBytes(mugshot, "This is a test...")
MessageBox.Show(encrypted.Length)

Dim decrypted() As Byte
decrypted = DecryptBytes(encrypted, "This is a test...")
MessageBox.Show(decrypted.Length)

Dim fout As New FileStream("testout.jpg", FileMode.Create)
fout.Write(decrypted, 0, decrypted.Length)
fout.Close()
End Sub

This doesn't seem to bother the jpeg files...they read just fine. But
what if it WASN'T a jpeg? Is it the encrypt/decrypt routine or the
file IO stuff that's adding the extra bytes?

Any help appreciated.

Nov 21 '05 #3
P.S. I was able to get rid of the extra bytes in the encryption by changing
the code as shown below.
I have noticed Memory Streams work differently then File streams. As I am
just learning Cryptography and am actually encrypting differently then you
are, I am not sure of the impact of this.

I would (and am going to) play with this to find out the answers. Another
article that would be worth going through is
http://www.dotnetdevs.com/articles/UsingEncryption.aspx

If you want things to look like they are secure you can short cut it, but if
you want things to be secure, it looks like there is a bit more work to do.
That is where I am with it now.

HTH

' Write the byte array to the crypto stream and flush it.
'cStream.Write(Data, 0, Data.Length)

'cStream.FlushFinalBlock()

' Initialize a buffer

Dim bufferLen As Integer = 4096

Dim buffer(bufferLen) As Byte

Dim bytesRead As Integer

' Create buffer to hold the decrypted data.

Dim toEncrypt As New MemoryStream

Dim s As Stream

toEncrypt.Write(Data, 0, Data.Length)

toEncrypt.Position = 0

Do

' Read a chunk of data from the MemoryStream

bytesRead = toEncrypt.Read(buffer, 0, bufferLen)

' Decrypt it

cStream.Write(buffer, 0, bytesRead)

Loop While bytesRead <> 0

"DazedAndConfused" <Ac********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
The following line sets fromEncypt to the same size as data length
(actually data length + 1)
so you have 9 extra (0) bytes at the end. I think the 8 bytes are the
encryption key.

' Create buffer to hold the decrypted data.

Dim fromEncrypt(Data.Length ) As Byte

you could do this:

' Create buffer to hold the decrypted data.

Dim fromEncrypt(Data.Length - 9) As Byte

or

I think the right way is something like this (NOTE: in DecryptBytes that
"CryptoStreamMode.Write" is Write NOT Read - This is NOT a mistype, it
needs to be this way, the same is true for csDecrypt.Write, then change
Return to msDecrypt.ToArray , you will also be writing directly from Data,
no need for fromEncrypt) . For more information on this go to:

http://blogs.gotdotnet.com/ivanmed/P...6-5973106935a4

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write) <=== Changed this line

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Write(Data, 0, Data.Length -1) <=== Changed this line

'Convert the buffer into a string and return it.
Return msDecrypt.ToArray <==== Changed this line.
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function
"Phillip Ian" <ph****@comcast.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Version: VS 2005

I took the sample code from help about encrypting and decrypting
strings, and changed it to work directly with byte arrays and get the
key and IV values from functions I've written to privide them. No
other changes were made...

Friend Function EncryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a MemoryStream.
Dim mStream As New MemoryStream

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim cStream As New CryptoStream(mStream, New
TripleDESCryptoServiceProvider().CreateEncryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write)

' Write the byte array to the crypto stream and flush it.
cStream.Write(Data, 0, Data.Length)
cStream.FlushFinalBlock()

' Get an array of bytes from the
' MemoryStream that holds the
' encrypted data.
Dim ret As Byte() = mStream.ToArray()

' Close the streams.
cStream.Close()
mStream.Close()

' Return the encrypted buffer.
Return ret
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Read)

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length)

'Convert the buffer into a string and return it.
Return fromEncrypt
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

When I encrypt and decrypt a file, the file ends up with extra blank
bytes on the end of it. My encrypt/decrypt routine is as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim fin As New FileStream("test.jpg", FileMode.Open)
Dim mugshot(fin.Length) As Byte
fin.Read(mugshot, 0, fin.Length)
fin.Close()
MessageBox.Show(mugshot.Length)

Dim encrypted() As Byte
encrypted = EncryptBytes(mugshot, "This is a test...")
MessageBox.Show(encrypted.Length)

Dim decrypted() As Byte
decrypted = DecryptBytes(encrypted, "This is a test...")
MessageBox.Show(decrypted.Length)

Dim fout As New FileStream("testout.jpg", FileMode.Create)
fout.Write(decrypted, 0, decrypted.Length)
fout.Close()
End Sub

This doesn't seem to bother the jpeg files...they read just fine. But
what if it WASN'T a jpeg? Is it the encrypt/decrypt routine or the
file IO stuff that's adding the extra bytes?

Any help appreciated.


Nov 21 '05 #4
The problem occurs because the TripleDES algorithm will only work on 16 bytes
of data. So, the Encrypt must pad the data to make it an even multiple of 16
in order to encrypt it.

Make sure you call FlushFinalBlock on the stream when you are decrypting so
the padded characters are removed.

"Phillip Ian" wrote:
Version: VS 2005

I took the sample code from help about encrypting and decrypting
strings, and changed it to work directly with byte arrays and get the
key and IV values from functions I've written to privide them. No
other changes were made...

Friend Function EncryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a MemoryStream.
Dim mStream As New MemoryStream

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim cStream As New CryptoStream(mStream, New
TripleDESCryptoServiceProvider().CreateEncryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Write)

' Write the byte array to the crypto stream and flush it.
cStream.Write(Data, 0, Data.Length)
cStream.FlushFinalBlock()

' Get an array of bytes from the
' MemoryStream that holds the
' encrypted data.
Dim ret As Byte() = mStream.ToArray()

' Close the streams.
cStream.Close()
mStream.Close()

' Return the encrypted buffer.
Return ret
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

Friend Function DecryptBytes(ByVal Data() As Byte, ByVal APassphrase
As String) As Byte()
Try
' Create a new MemoryStream using the passed
' array of encrypted data.
Dim msDecrypt As New MemoryStream(Data)

' Create a CryptoStream using the MemoryStream
' and the passed key and initialization vector (IV).
Dim csDecrypt As New CryptoStream(msDecrypt, New
TripleDESCryptoServiceProvider().CreateDecryptor(G etKey(APassphrase),
GetIV(APassphrase)), CryptoStreamMode.Read)

' Create buffer to hold the decrypted data.
Dim fromEncrypt(Data.Length) As Byte

' Read the decrypted data out of the crypto stream
' and place it into the temporary buffer.
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length)

'Convert the buffer into a string and return it.
Return fromEncrypt
Catch e As CryptographicException
Console.WriteLine("A Cryptographic error occurred: " & e.Message)
Return Nothing
End Try
End Function

When I encrypt and decrypt a file, the file ends up with extra blank
bytes on the end of it. My encrypt/decrypt routine is as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim fin As New FileStream("test.jpg", FileMode.Open)
Dim mugshot(fin.Length) As Byte
fin.Read(mugshot, 0, fin.Length)
fin.Close()
MessageBox.Show(mugshot.Length)

Dim encrypted() As Byte
encrypted = EncryptBytes(mugshot, "This is a test...")
MessageBox.Show(encrypted.Length)

Dim decrypted() As Byte
decrypted = DecryptBytes(encrypted, "This is a test...")
MessageBox.Show(decrypted.Length)

Dim fout As New FileStream("testout.jpg", FileMode.Create)
fout.Write(decrypted, 0, decrypted.Length)
fout.Close()
End Sub

This doesn't seem to bother the jpeg files...they read just fine. But
what if it WASN'T a jpeg? Is it the encrypt/decrypt routine or the
file IO stuff that's adding the extra bytes?

Any help appreciated.

Nov 21 '05 #5

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

Similar topics

1
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); ...
4
by: Fritjolf | last post by:
Hi. I've got a strange problem... I've made a simple program to test encryption/decryption. I use Rijndael encryption and here are the most important properties. RijndaelManaged cipher =...
3
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...
9
by: Betikci Boris | last post by:
I get bored last night and wrote a script that uses xor for encrypt- decrypt, however it woks fine under linux 2.6.25, text and documents are ok, but fails on compressed files *.jpg, *.pdf , etc ....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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.