473,837 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to decrypt a serailized binary formatted object

I encryted a serialized binary formatted object. Now I can't figure out how
to deserialize it so that I can decrypt it.

I used this code encrypt and write it out:
Dim fe As New MortgageFileWri ter.FileEncrypt

Dim myBuffer As New IO.MemoryStream

Dim OutBuffer As New IO.MemoryStream

Dim fsBuffer As New StreamWriter(Ou tBuffer)

fsBuffer.Write( company)

fe.EncryptFile( myBuffer, OutBuffer)

bf.Serialize(da taStream, OutBuffer)

dataStream.Clos e()

Sub EncryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Dim fsInput As New FileStream(inFi leName, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New FileStream(outF ileName, FileMode.Create ,
FileAccess.Writ e)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=", Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

'Read unencrypted file input into the buffer byte array.

Dim byteBuffer(CInt (inBuffer.Lengt h - 1)) As Byte

inBuffer.Read(b yteBuffer, 0, byteBuffer.Leng th)

'Dim byteBuffer(CInt (fsInput.Length ) - 1) As Byte

'fsInput.Read(b yteBuffer, 0, byteBuffer.Leng th)

' Create CryptoStream with write access to encrypt filestream using RC2

Dim cs As New CryptoStream(ou tBuffer, rc2.CreateEncry ptor(),
CryptoStreamMod e.Write)

' Write CryptoStream bytes from buffer from offset 0 to end of buffer

cs.Write(byteBu ffer, 0, byteBuffer.Leng th)

cs.Flush()

cs.Close()

inBuffer.Close( )

'fsOutput.Close ()

End Sub

This is the decription procedure

Sub DecryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Create file stream to read encrypted file.

'Dim fsInput As New FileStream(inBu ffer, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New StreamWriter(ou tFileName)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=", Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

' Create the crypto stream with read access to decrypt incoming bytes using
RC2.

Try

Dim cryptostreamDec r As New CryptoStream(in Buffer, rc2.CreateDecry ptor(),
CryptoStreamMod e.Read)

Dim fsBuffer As New StreamWriter(ou tBuffer)

' Write out the decrypted file.

fsBuffer.Write( New StreamReader(cr yptostreamDecr) .ReadToEnd)

fsBuffer.Flush( )

'inBuffer.Close ()

'fsBuffer.Close ()

Catch ex As Exception

Dim str As String

str = ex.Message

End Try

'fsOutput.Write (New StreamReader(cr yptostreamDecr) .ReadToEnd)

'fsOutput.Flush ()

'fsInput.Close( )

'fsOutput.Close ()

End Sub
Nov 21 '05 #1
4 1415
Never mind, I still do not have the first part right.
"DazedAndConfus ed" <Ac********@yah oo.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I encryted a serialized binary formatted object. Now I can't figure out how
to deserialize it so that I can decrypt it.

I used this code encrypt and write it out:
Dim fe As New MortgageFileWri ter.FileEncrypt

Dim myBuffer As New IO.MemoryStream

Dim OutBuffer As New IO.MemoryStream

Dim fsBuffer As New StreamWriter(Ou tBuffer)

fsBuffer.Write( company)

fe.EncryptFile( myBuffer, OutBuffer)

bf.Serialize(da taStream, OutBuffer)

dataStream.Clos e()

Sub EncryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Dim fsInput As New FileStream(inFi leName, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New FileStream(outF ileName, FileMode.Create ,
FileAccess.Writ e)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

'Read unencrypted file input into the buffer byte array.

Dim byteBuffer(CInt (inBuffer.Lengt h - 1)) As Byte

inBuffer.Read(b yteBuffer, 0, byteBuffer.Leng th)

'Dim byteBuffer(CInt (fsInput.Length ) - 1) As Byte

'fsInput.Read(b yteBuffer, 0, byteBuffer.Leng th)

' Create CryptoStream with write access to encrypt filestream using RC2

Dim cs As New CryptoStream(ou tBuffer, rc2.CreateEncry ptor(),
CryptoStreamMod e.Write)

' Write CryptoStream bytes from buffer from offset 0 to end of buffer

cs.Write(byteBu ffer, 0, byteBuffer.Leng th)

cs.Flush()

cs.Close()

inBuffer.Close( )

'fsOutput.Close ()

End Sub

This is the decription procedure

Sub DecryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Create file stream to read encrypted file.

'Dim fsInput As New FileStream(inBu ffer, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New StreamWriter(ou tFileName)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

' Create the crypto stream with read access to decrypt incoming bytes
using RC2.

Try

Dim cryptostreamDec r As New CryptoStream(in Buffer, rc2.CreateDecry ptor(),
CryptoStreamMod e.Read)

Dim fsBuffer As New StreamWriter(ou tBuffer)

' Write out the decrypted file.

fsBuffer.Write( New StreamReader(cr yptostreamDecr) .ReadToEnd)

fsBuffer.Flush( )

'inBuffer.Close ()

'fsBuffer.Close ()

Catch ex As Exception

Dim str As String

str = ex.Message

End Try

'fsOutput.Write (New StreamReader(cr yptostreamDecr) .ReadToEnd)

'fsOutput.Flush ()

'fsInput.Close( )

'fsOutput.Close ()

End Sub

Nov 21 '05 #2
The following is a simple serialization of the Structure "TestSerial ize by
serializing one instance of the structure "t" then deserializing it back
into "ot"

Hope this helps.

Public Sut TestingSerialze
Dim t As TestSerialize
Dim ot As TestSerialize
Dim formatter As New BinaryFormatter
Dim s As New MemoryStream
Dim i As Integer
t.i = 125
t.a = "This is a test of Serialilzing a structure"
t.b = New Byte() {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}
formatter.Seria lize(s, t)
' Deserialize
s.Seek(0, SeekOrigin.Begi n)
'ot = DirectCast(form atter.Deseriali ze(s), TestSerialize)
ot = formatter.Deser ialize(s)
i = 0
end sub

<Serializable() > Public Structure TestSerialize
Dim i As Integer
Dim a As String
Dim b As Byte()
End Structure
--
Dennis in Houston
"DazedAndConfus ed" wrote:
Never mind, I still do not have the first part right.
"DazedAndConfus ed" <Ac********@yah oo.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I encryted a serialized binary formatted object. Now I can't figure out how
to deserialize it so that I can decrypt it.

I used this code encrypt and write it out:
Dim fe As New MortgageFileWri ter.FileEncrypt

Dim myBuffer As New IO.MemoryStream

Dim OutBuffer As New IO.MemoryStream

Dim fsBuffer As New StreamWriter(Ou tBuffer)

fsBuffer.Write( company)

fe.EncryptFile( myBuffer, OutBuffer)

bf.Serialize(da taStream, OutBuffer)

dataStream.Clos e()

Sub EncryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Dim fsInput As New FileStream(inFi leName, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New FileStream(outF ileName, FileMode.Create ,
FileAccess.Writ e)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

'Read unencrypted file input into the buffer byte array.

Dim byteBuffer(CInt (inBuffer.Lengt h - 1)) As Byte

inBuffer.Read(b yteBuffer, 0, byteBuffer.Leng th)

'Dim byteBuffer(CInt (fsInput.Length ) - 1) As Byte

'fsInput.Read(b yteBuffer, 0, byteBuffer.Leng th)

' Create CryptoStream with write access to encrypt filestream using RC2

Dim cs As New CryptoStream(ou tBuffer, rc2.CreateEncry ptor(),
CryptoStreamMod e.Write)

' Write CryptoStream bytes from buffer from offset 0 to end of buffer

cs.Write(byteBu ffer, 0, byteBuffer.Leng th)

cs.Flush()

cs.Close()

inBuffer.Close( )

'fsOutput.Close ()

End Sub

This is the decription procedure

Sub DecryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Create file stream to read encrypted file.

'Dim fsInput As New FileStream(inBu ffer, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New StreamWriter(ou tFileName)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

' Create the crypto stream with read access to decrypt incoming bytes
using RC2.

Try

Dim cryptostreamDec r As New CryptoStream(in Buffer, rc2.CreateDecry ptor(),
CryptoStreamMod e.Read)

Dim fsBuffer As New StreamWriter(ou tBuffer)

' Write out the decrypted file.

fsBuffer.Write( New StreamReader(cr yptostreamDecr) .ReadToEnd)

fsBuffer.Flush( )

'inBuffer.Close ()

'fsBuffer.Close ()

Catch ex As Exception

Dim str As String

str = ex.Message

End Try

'fsOutput.Write (New StreamReader(cr yptostreamDecr) .ReadToEnd)

'fsOutput.Flush ()

'fsInput.Close( )

'fsOutput.Close ()

End Sub


Nov 21 '05 #3
I'll take a closer look, but the serialization has been working, the problem
arises when I attempt to encrypt the object and then try to decrpt it. I'm
not even sure you can do this.
"Dennis" <De****@discuss ions.microsoft. com> wrote in message
news:95******** *************** ***********@mic rosoft.com...
The following is a simple serialization of the Structure "TestSerial ize by
serializing one instance of the structure "t" then deserializing it back
into "ot"

Hope this helps.

Public Sut TestingSerialze
Dim t As TestSerialize
Dim ot As TestSerialize
Dim formatter As New BinaryFormatter
Dim s As New MemoryStream
Dim i As Integer
t.i = 125
t.a = "This is a test of Serialilzing a structure"
t.b = New Byte() {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}
formatter.Seria lize(s, t)
' Deserialize
s.Seek(0, SeekOrigin.Begi n)
'ot = DirectCast(form atter.Deseriali ze(s), TestSerialize)
ot = formatter.Deser ialize(s)
i = 0
end sub

<Serializable() > Public Structure TestSerialize
Dim i As Integer
Dim a As String
Dim b As Byte()
End Structure
--
Dennis in Houston
"DazedAndConfus ed" wrote:
Never mind, I still do not have the first part right.
"DazedAndConfus ed" <Ac********@yah oo.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
>I encryted a serialized binary formatted object. Now I can't figure out
>how
>to deserialize it so that I can decrypt it.
>
> I used this code encrypt and write it out:
> Dim fe As New MortgageFileWri ter.FileEncrypt
>
> Dim myBuffer As New IO.MemoryStream
>
> Dim OutBuffer As New IO.MemoryStream
>
> Dim fsBuffer As New StreamWriter(Ou tBuffer)
>
> fsBuffer.Write( company)
>
> fe.EncryptFile( myBuffer, OutBuffer)
>
> bf.Serialize(da taStream, OutBuffer)
>
> dataStream.Clos e()
>
> Sub EncryptFile( _
>
> ByVal inBuffer As IO.MemoryStream , _
>
> ByVal outBuffer As IO.MemoryStream )
>
> 'Dim fsInput As New FileStream(inFi leName, FileMode.Open,
> FileAccess.Read )
>
> 'Dim fsOutput As New FileStream(outF ileName, FileMode.Create ,
> FileAccess.Writ e)
>
> Dim cdk As New PasswordDeriveB ytes( _
>
> "1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
> Nothing)
>
>
>
> ' generate an RC2 key
>
> Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}
>
> Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)
>
> ' setup an RC2 object to encrypt with the derived key
>
> Dim rc2 As New RC2CryptoServic eProvider
>
> rc2.Key = key
>
> rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}
>
> 'Read unencrypted file input into the buffer byte array.
>
> Dim byteBuffer(CInt (inBuffer.Lengt h - 1)) As Byte
>
> inBuffer.Read(b yteBuffer, 0, byteBuffer.Leng th)
>
> 'Dim byteBuffer(CInt (fsInput.Length ) - 1) As Byte
>
> 'fsInput.Read(b yteBuffer, 0, byteBuffer.Leng th)
>
> ' Create CryptoStream with write access to encrypt filestream using RC2
>
> Dim cs As New CryptoStream(ou tBuffer, rc2.CreateEncry ptor(),
> CryptoStreamMod e.Write)
>
> ' Write CryptoStream bytes from buffer from offset 0 to end of buffer
>
> cs.Write(byteBu ffer, 0, byteBuffer.Leng th)
>
> cs.Flush()
>
> cs.Close()
>
> inBuffer.Close( )
>
> 'fsOutput.Close ()
>
> End Sub
>
>
>
> This is the decription procedure
>
> Sub DecryptFile( _
>
> ByVal inBuffer As IO.MemoryStream , _
>
> ByVal outBuffer As IO.MemoryStream )
>
> 'Create file stream to read encrypted file.
>
> 'Dim fsInput As New FileStream(inBu ffer, FileMode.Open,
> FileAccess.Read )
>
> 'Dim fsOutput As New StreamWriter(ou tFileName)
>
> Dim cdk As New PasswordDeriveB ytes( _
>
> "1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
> Nothing)
>
> ' generate an RC2 key
>
> Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}
>
> Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)
>
> ' setup an RC2 object to encrypt with the derived key
>
> Dim rc2 As New RC2CryptoServic eProvider
>
> rc2.Key = key
>
> rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}
>
> ' Create the crypto stream with read access to decrypt incoming bytes
> using RC2.
>
> Try
>
> Dim cryptostreamDec r As New CryptoStream(in Buffer,
> rc2.CreateDecry ptor(),
> CryptoStreamMod e.Read)
>
> Dim fsBuffer As New StreamWriter(ou tBuffer)
>
> ' Write out the decrypted file.
>
> fsBuffer.Write( New StreamReader(cr yptostreamDecr) .ReadToEnd)
>
> fsBuffer.Flush( )
>
> 'inBuffer.Close ()
>
> 'fsBuffer.Close ()
>
> Catch ex As Exception
>
> Dim str As String
>
> str = ex.Message
>
> End Try
>
>
>
>
>
> 'fsOutput.Write (New StreamReader(cr yptostreamDecr) .ReadToEnd)
>
> 'fsOutput.Flush ()
>
> 'fsInput.Close( )
>
> 'fsOutput.Close ()
>
> End Sub
>
>


Nov 21 '05 #4
I found the answer to my problem at :
Ivan Medvedev's blog
http://blogs.gotdotnet.com/ivanmed/P...6-5973106935a4

After banging my head for five days the problem was using
CryptoStreamMod e.Read in the Decryption. You can use it
(CryptoStreamMo de.Read ) for decrypting file and network streams, but
apparently you need to use CryptoStreamMod e.Write for Memory.

Although I am still somewhat confused and definitely dazed!

THANK YOU IVAN!!
"DazedAndConfus ed" <Ac********@yah oo.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I encryted a serialized binary formatted object. Now I can't figure out how
to deserialize it so that I can decrypt it.

I used this code encrypt and write it out:
Dim fe As New MortgageFileWri ter.FileEncrypt

Dim myBuffer As New IO.MemoryStream

Dim OutBuffer As New IO.MemoryStream

Dim fsBuffer As New StreamWriter(Ou tBuffer)

fsBuffer.Write( company)

fe.EncryptFile( myBuffer, OutBuffer)

bf.Serialize(da taStream, OutBuffer)

dataStream.Clos e()

Sub EncryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Dim fsInput As New FileStream(inFi leName, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New FileStream(outF ileName, FileMode.Create ,
FileAccess.Writ e)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

'Read unencrypted file input into the buffer byte array.

Dim byteBuffer(CInt (inBuffer.Lengt h - 1)) As Byte

inBuffer.Read(b yteBuffer, 0, byteBuffer.Leng th)

'Dim byteBuffer(CInt (fsInput.Length ) - 1) As Byte

'fsInput.Read(b yteBuffer, 0, byteBuffer.Leng th)

' Create CryptoStream with write access to encrypt filestream using RC2

Dim cs As New CryptoStream(ou tBuffer, rc2.CreateEncry ptor(),
CryptoStreamMod e.Write)

' Write CryptoStream bytes from buffer from offset 0 to end of buffer

cs.Write(byteBu ffer, 0, byteBuffer.Leng th)

cs.Flush()

cs.Close()

inBuffer.Close( )

'fsOutput.Close ()

End Sub

This is the decription procedure

Sub DecryptFile( _

ByVal inBuffer As IO.MemoryStream , _

ByVal outBuffer As IO.MemoryStream )

'Create file stream to read encrypted file.

'Dim fsInput As New FileStream(inBu ffer, FileMode.Open, FileAccess.Read )

'Dim fsOutput As New StreamWriter(ou tFileName)

Dim cdk As New PasswordDeriveB ytes( _

"1E1705459E1B35 20943FC00CF8E7C EEDA68BF5FAgtGp sCVNkFAo3am992z 7kgc=",
Nothing)

' generate an RC2 key

Dim iv() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

Dim key As Byte() = cdk.CryptDerive Key("RC2", "SHA1", 128, iv)

' setup an RC2 object to encrypt with the derived key

Dim rc2 As New RC2CryptoServic eProvider

rc2.Key = key

rc2.IV = New Byte() {21, 22, 23, 24, 25, 26, 27, 28}

' Create the crypto stream with read access to decrypt incoming bytes
using RC2.

Try

Dim cryptostreamDec r As New CryptoStream(in Buffer, rc2.CreateDecry ptor(),
CryptoStreamMod e.Read)

Dim fsBuffer As New StreamWriter(ou tBuffer)

' Write out the decrypted file.

fsBuffer.Write( New StreamReader(cr yptostreamDecr) .ReadToEnd)

fsBuffer.Flush( )

'inBuffer.Close ()

'fsBuffer.Close ()

Catch ex As Exception

Dim str As String

str = ex.Message

End Try

'fsOutput.Write (New StreamReader(cr yptostreamDecr) .ReadToEnd)

'fsOutput.Flush ()

'fsInput.Close( )

'fsOutput.Close ()

End Sub

Nov 21 '05 #5

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

Similar topics

103
48794
by: Steven T. Hatton | last post by:
§27.4.2.1.4 Type ios_base::openmode Says this about the std::ios::binary openmode flag: *binary*: perform input and output in binary mode (as opposed to text mode) And that is basically _all_ it says about it. What the heck does the binary flag mean? -- If our hypothesis is about anything and not about some one or more particular things, then our deductions constitute mathematics. Thus mathematics may be defined as the subject in...
7
7844
by: Jean Christophe Avard | last post by:
Hi! I am designing an application wich comes with image file. These images are copyrighted and they have to be accessible only from within the application. At first, I tought I was going to store them in a database, but since there will be much more than 2go, I'm going to need multiple database, and it's no good for CPU performance... I read about encrypting picture instead of storing them in a DB. But I only found thing about string...
26
4338
by: Patient Guy | last post by:
Has anyone written code that successfully manipulates binary file data using Javascript? It might---and in the case of doing I/O, will---make use of browser- specific functions (ActiveX/COM with Internet Explorer, XPCOM/XPConnect with Mozilla/Firefox). I am writing client-side code that will generate binary data for producing a GIF file through an OBJECT element. (The GIF is an image of a line and points on a two-axis plot.)
2
2507
by: Wayne Marsh | last post by:
Hello, Is it considered sane/good practice to write a global operator for the insertion and extraction operators of an fstream in binary mode to serialize a binary class, or are they strictly meant for formatted text input and output? Let's imagine, for example, that I had a standard Windows BMP file (I am aware that C++ has no concept of a BMP - this is simply putting my question in a simple context). If I wanted to load it into a...
0
9839
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
9682
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
10871
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
10564
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...
1
10621
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10268
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5846
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4474
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
4039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.