View Full Version : Eye I Need Your Help!!!!!!!!!!
Well by now ya'll should know I'm going to school agian (yipie). But I've got some VB/ Gooie class next quarter/semester.. what ever its called at this year round school. Anyways, He said if we could write a program in VB to hide codeing in Jpgs when would get an automatic 100% on everything in the class. Probably need to beable to decode it too. But yeah any ideas on wherre I might find the coding needed to get put on easy street?
eyelleye
02-19-2005, 10:54 PM
To hide coding in jpgs?
what exactly do you mean? To hide text in jpgs? Hmm... Im guessing this is probably actual VB and not VB Script (which is where my exp with VB lies)... Hmmm... what your asking for is what's called Steganography.
Looking around on the web, I dug this up with a quick google search:
http://www.vb-helper.com/tutorial_steganography.html
Unfortunately I dont have Visual Studio... otherwise I could probably help you code it. For starters, Id say check out that link. The "tutorial" only explains how you might go about doing it... actually, that seems like it'd be a fun challenge to do. Why didnt they have that kinda cool shit when I was taking CS classes? We got dumb projects in C++ like doing a conversion thing from C to F and back agian.
eyelleye
02-19-2005, 10:59 PM
A few more:
http://www.a1vbcode.com/app.asp?ID=3005
http://www.thecodeproject.com/csharp/steganodotnet.asp
Try Googling: Visual Basic Howto steganography
You da Man Eye. Yeah we are just finishing up introduction to computer programing (basic VB). Next quarter is VB and gooie. Since I'm in the multi media studies, I would like to get out of this programing crap with out going crazy. Plus I think it would be cool to send secret squarl imagies lol.
eyelleye
02-20-2005, 10:21 PM
LOL... well, lemme know when you get more info... As I recall MS has some dumbed down versions of VS for tinkerers and students... Ive actually got one or two DLd at work. Might be able to lend a hand when the time comes.
Eye did you ever Dl the working copy of steganography from that web site
http://www.vb-helper.com/tutorial_steganography.html ?
Well it doesn't work or I am not getting it to work correctly ( I know its probably the second one, but I would rather blame the programer first.)
Also what the hell is that code saying? Its got more variables then alaska has feet of snow. So needless to say I am confused about the whole fing thing.
Oh and here is the Teachers comments on the project... Ahem.. and I qoate:
"You are very concerned about data security on the internet, especially when you send an email to your friends telling them about your weekend. After all, not everybody is supposed to find out what you did or plan on doing." ( guess they will just have to wait for the video to hit the internet like everyone else :p) "Design an application that allows a user to hide text within an image file attached to an email, encrypt it at the source, and decrypt it at the destination. If you chose to program this project, a detailed documentation has to be turned in as well. Also, as part of the documentation, you have to include comments in the code explaining its function."
So yeah I dl the working copy from that site ( its got an error in the script somewhere by the way) and have no Idea what the heck anything is doing. So any words of wisdom would be appreciated.
eyelleye
04-02-2005, 12:33 PM
I'll have a looksee either tonight (after work) or tomorrow (when Im off work). I don't have visual studio, so might run into some issues there... but there are some dumbed down student versions of the individual studio apps available from MS... I'll take a look for those too & then take a look at the code to see if I can help explain it &/or figure out whats wrong with it. =) On fridays I usually don't get off work until 10pm, so don't even end up turning on the PC when I get home but go right to bed.
eyelleye
04-04-2005, 01:18 AM
At this rate, wont have a chance to look at this til 2morrow (monday). Downloading the visual basic express 2005 beta (only thing I can really get) to have a look at this... as the DL is around 300mb, going to take it a little bit to DL, so by the time its done & installed, I'll more than likely be heading to lala land. Though I had this DLd already, but I have the visual web developer thing DLd, which is a bit diff I guess.
Anyways, I'll look into it as soon as I can.
eyelleye
04-04-2005, 11:27 AM
Not sure if Im going to be able to help. I got the VB Express Beta downloaded at work, but cant open anything as Im missing a designtime license. Consequently, it cant convert exisiting vb6 code over to vb.net code so I can even look at the damn thing... sure I can look at part of it via notepad but... grr.
eyelleye
04-04-2005, 01:34 PM
http://www.devx.com/dotnet/Article/22667
Hmmmm...I find this type of intellectual discussion disturbing.
http://www.devx.com/dotnet/Article/22667
Is that VB script eye? Maybe I'm just stupid ( would be the first time) but it looks like it could be C++ or something else, I just don't recognise the code. I have to do it in basic VB so maybe that might be my other problem since none of these that I have checked out seem to be writen for basic Visual Basic.
eyelleye
04-06-2005, 11:16 AM
It looks like it could be c# code, but the concepts should carry over. Wish I had visual studio, then I could be of more help.
The other thing I noticed, are you sure it has to be a .jpg? Most of these seem to use .bmps, as they write data to the lsf (least significant bit), which are in turn tossed out in a .jpg (thats how it does its file compression).
Oh... and when is the project due? =)
Ah I'm sure if I used a Bmp. formate he wouldn't care. Hell last semester my VB project really didn't work ( It was the code he told me to use I'm sure of it :p ), so as long as I get something to work I should be fine. Ah crap its due in 6 weeks I think, I'll get an exact date for yeah later.
Back on subject, yeah everything I have read has said that Jpeg will not work with any concistency because of the way it compresses it. So I guess I'll have to use a bmp... But I really don't know the diffrence between the 2.
eyelleye
04-07-2005, 11:28 AM
6 weeks... thats not so bad then... Maybe sunday, when Im home, I can have another gander at it.
I've seen some commercial products that can get away with using .jpgs, but Id reckon that's beyond the scope of this class.
So Whats wrong with the code Eye and How do i get a .FRX to help VB do this hidden picture crap?
Option Explicit
Private Sub ArrangeControls()
Dim wid As Single
Width = picImage.Left + picImage.Width + Width - ScaleWidth + 120
Height = picImage.Top + picImage.Height + Height - ScaleHeight + 120
wid = ScaleWidth - txtMessage.Left - 120
If wid < 120 Then wid = 120
txtMessage.Width = wid
txtPassword.Width = wid
End Sub
' Encode this byte's data.
Private Sub EncodeByte(ByVal Value As Byte, ByVal used_positions As Collection, ByVal wid As Integer, ByVal hgt As Integer, ByVal show_pixels As Boolean)
Dim i As Integer
Dim byte_mask As Integer
Dim r As Integer
Dim c As Integer
Dim pixel As Integer
Dim clrr As Byte
Dim clrg As Byte
Dim clrb As Byte
Dim color_mask As Integer
byte_mask = 1
For i = 1 To 8
' Pick a random pixel and RGB component.
PickPosition used_positions, wid, hgt, r, c, pixel
' Get the pixel's color components.
UnRGB picImage.Point(r, c), clrr, clrg, clrb
If show_pixels Then
clrr = 255
clrg = clrg And &H1
clrb = clrb And &H1
End If
' Get the value we must store.
If Value And byte_mask Then
color_mask = 1
Else
color_mask = 0
End If
' Update the color.
Select Case pixel
Case 0
clrr = (clrr And &HFE) Or color_mask
Case 1
clrg = (clrg And &HFE) Or color_mask
Case 2
clrb = (clrb And &HFE) Or color_mask
End Select
' Set the pixel's color.
picImage.PSet (r, c), RGB(clrr, clrg, clrb)
byte_mask = byte_mask * 2
Next i
End Sub
' Decode this byte's data.
Private Function DecodeByte(ByVal used_positions As Collection, ByVal wid As Integer, ByVal hgt As Integer, ByVal show_pixels As Boolean) As Byte
Dim Value As Integer
Dim i As Integer
Dim byte_mask As Integer
Dim r As Integer
Dim c As Integer
Dim pixel As Integer
Dim clrr As Byte
Dim clrg As Byte
Dim clrb As Byte
Dim color_mask As Integer
byte_mask = 1
For i = 1 To 8
' Pick a random pixel and RGB component.
PickPosition used_positions, wid, hgt, r, c, pixel
' Get the pixel's color components.
UnRGB picImage.Point(r, c), clrr, clrg, clrb
' Get the stored value.
Select Case pixel
Case 0
color_mask = (clrr And &H1)
Case 1
color_mask = (clrg And &H1)
Case 2
color_mask = (clrb And &H1)
End Select
If color_mask Then
Value = Value Or byte_mask
End If
If show_pixels Then
picImage.PSet (r, c), RGB( _
clrr And &H1, _
clrg And &H1, _
clrb And &H1)
End If
byte_mask = byte_mask * 2
Next i
DecodeByte = CByte(Value)
End Function
' Translate a password into an offset value.
Private Function NumericPassword(ByVal password As String) As Long
Dim Value As Long
Dim ch As Long
Dim shift1 As Long
Dim shift2 As Long
Dim i As Integer
Dim str_len As Integer
' Initialize the shift values to different
' non-zero values.
shift1 = 3
shift2 = 17
' Process the message.
str_len = Len(password)
For i = 1 To str_len
' Add the next letter.
ch = Asc(Mid$(password, i, 1))
Value = Value Xor (ch * 2 ^ shift1)
Value = Value Xor (ch * 2 ^ shift2)
' Change the shift offsets.
shift1 = (shift1 + 7) Mod 19
shift2 = (shift2 + 13) Mod 23
Next i
NumericPassword = Value
End Function
' Pick an unused (r, c, pixel) combination.
Private Sub PickPosition(ByVal used_positions As Collection, ByVal wid As Integer, ByVal hgt As Integer, ByRef r As Integer, ByRef c As Integer, ByRef pixel As Integer)
Dim position_code As String
On Error Resume Next
Do
' Pick a position.
r = Int(Rnd * wid)
c = Int(Rnd * hgt)
pixel = Int(Rnd * 3)
' See if the position is unused.
position_code = "(" & r & "," & c & "," & pixel & ")"
used_positions.Add position_code, position_code
If Err.Number = 0 Then Exit Do
Err.Clear
Loop
End Sub
' Return the color's components.
Private Sub UnRGB(ByVal color As OLE_COLOR, ByRef r As Byte, ByRef g As Byte, ByRef b As Byte)
r = color And &HFF&
g = (color And &HFF00&) \ &H100&
b = (color And &HFF0000) \ &H10000
End Sub
Private Sub cmdDecode_Click()
Dim msg_length As Byte
Dim msg As String
Dim ch As Byte
Dim i As Integer
Dim used_positions As Collection
Dim wid As Integer
Dim hgt As Integer
Dim show_pixels As Boolean
Screen.MousePointer = vbHourglass
DoEvents
' Initialize the random number generator.
Rnd -1
Randomize NumericPassword(txtPassword.Text)
wid = picImage.ScaleWidth
hgt = picImage.ScaleHeight
show_pixels = chkShowPixels.Value
Set used_positions = New Collection
' Decode the message length.
msg_length = DecodeByte(used_positions, wid, hgt, show_pixels)
' Decode the message.
For i = 1 To msg_length
ch = DecodeByte(used_positions, wid, hgt, show_pixels)
msg = msg & Chr$(ch)
Next i
picImage.Picture = picImage.Image
txtMessage.Text = msg
Screen.MousePointer = vbDefault
End Sub
Private Sub cmdEncode_Click()
Dim msg As String
Dim i As Integer
Dim used_positions As Collection
Dim wid As Integer
Dim hgt As Integer
Dim show_pixels As Boolean
Screen.MousePointer = vbHourglass
DoEvents
' Initialize the random number generator.
Rnd -1
Randomize NumericPassword(txtPassword.Text)
wid = picImage.ScaleWidth
hgt = picImage.ScaleHeight
msg = Left$(txtMessage.Text, 255)
show_pixels = chkShowPixels.Value
Set used_positions = New Collection
' Encode the message length.
EncodeByte CByte(Len(msg)), _
used_positions, wid, hgt, show_pixels
' Encode the message.
For i = 1 To Len(msg)
EncodeByte Asc(Mid$(msg, i, 1)), _
used_positions, wid, hgt, show_pixels
Next i
picImage.Picture = picImage.Image
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Load()
picImage.ScaleMode = vbPixels
picImage.AutoRedraw = True
dlgImage.InitDir = App.Path
ArrangeControls
End Sub
Private Sub mnuFileOpen_Click()
On Error Resume Next
dlgImage.CancelError = True
dlgImage.Flags = _
cdlOFNFileMustExist Or _
cdlOFNHideReadOnly Or _
cdlOFNLongNames
dlgImage.ShowOpen
If Err.Number <> 0 Then Exit Sub
picImage.Picture = LoadPicture(dlgImage.FileName)
ArrangeControls
If Err.Number <> 0 Then Exit Sub
dlgImage.InitDir = dlgImage.FileName
dlgImage.FileName = dlgImage.FileTitle
End Sub
Private Sub mnuFileSaveAs_Click()
On Error Resume Next
dlgImage.CancelError = True
dlgImage.Flags = _
cdlOFNOverwritePrompt Or _
cdlOFNHideReadOnly Or _
cdlOFNLongNames
dlgImage.ShowSave
If Err.Number <> 0 Then Exit Sub
SavePicture picImage.Picture, dlgImage.FileName
If Err.Number <> 0 Then Exit Sub
dlgImage.InitDir = dlgImage.FileName
dlgImage.FileName = dlgImage.FileTitle
End Sub
eyelleye
05-16-2005, 10:51 AM
The last time I tried to play with this code in my visual basic express beta it gave me some crap about not having the proper library or something. In a couple days (wednesday) I move downstairs to my new job where I'll have the full version of visual studio accessible to me. I'll try and take a look at it down there & see what the dillyo is.
Ok, just to let you know that .frx that comes with that coding ( think its a class module, but am not sure since it doesn't seem to have any code that I can tell) is the missing part. It has something to do with the picture box is all I can really tell you. But yeahI can't get it to work with anything else besides there stupid pic, so its not being user friendly for my atemps of pirating it :p
eyelleye
05-23-2005, 01:21 PM
Hmmm...
Well, it runs on my work machine under VS6, but gives no options for changing the image. I'm going to see if I have an old version of Visual Studio at home (might, not sure). I should think it would be fairly easy for us to add some form of user-selectable picture to this thing & then let it do what it does. Wish I had more free time here at work to have a look at it, as it didnt work at all under .net beta thing I had at home. I ordered the latest Visual Studio beta on cd (only way to get it) last week, but I doubt it will show up in time for me to play with it in that.
Your prof looked at it & couldnt figure it out? If that's the case, then Im assuming its ok that we use this code for your project... in which case, all we need to do really is to make it so we can import a picture, vs rewrite the entire thing.
eyelleye
05-24-2005, 10:59 AM
Well bahlz! My old cd of VS6 is corrupted at home, so that didnt work out so well. Im going to take a look at it during lunch, see if I can't see whats up with it. I know you said it was due this week, but maybe its your class you had on friday (I think).
eyelleye
05-24-2005, 03:52 PM
Hmmm... I managed to get it to compile just fine. Of course, it does appear to be vb6, so that could have been the problems with the .NET version I was trying at home, as well as problems you may have been having with it. Im going to guess you were working with .NET, tho I don't recall atm.
Im re-attaching the completed & compiled project to this post. Also included is an image I tried. Just choose "file > open" and select it & then type "pass" for the password & click decode. In the comments box or whatever, it should say test.
On a whim before lunch is over, I just tried converting it over to vb.NET & there are a host of problems with it that would have to be fixed for it to work. Im guessing it used a few things that didnt make the grade when it came to upgrade to .NET.
Scratch the attach... I'll upload em n post a link.
eyelleye
05-24-2005, 04:03 PM
http://eyelleye.net/downloads/howto_steganography.zip
http://eyelleye.net/downloads/Steganogrpahy_dotNET.zip
The dotNET one is non-functional atm, but has been converted & has auto-generated notes within the code in regard to the conversion.
Your the man Eye.... Freaking my supposive working coppy of VB on my new laptop isn't so I'll have to get to school early Friday and check it out. But hell if it works I can bullshit the rest.. Agian thanks for all the help Eye, I was dead in the water with out you.
eyelleye
05-25-2005, 11:56 AM
Well, like I said, the vb6 version works, but not sure if you need it in NET or not. If you do, then some additional work will have to be done to it... mostly stuff will have to be converted. I may play with it at home if my beta version of VS 2005 comes in.
IT WORKS!!!!!!!! Now if I only understood why it works lol. What was the problem with the first one? Thanks agian eye, wish i actualy understood this more... Oh since someone asked how would one go about hiding a viris in this. I was thinking an .exe could be hidden in one of the command buttons, with the viris writen as the hidden code. More of a curriosity thing for me, but you would know better then me if something like this could be done... LOL and no I am not planning on bugging my teachers comp if I don't get an A on this :p
eyelleye
05-28-2005, 01:18 AM
I'm sure you probably could embed a virus in it, but any decent virus scanner would pick it up, so... =) Now, as how to do that, I dunno. I havent fiddled with virus code since I was in school.
RE: the problem with the first one, Im not too sure. All I had here at home was the freebie download of the VB Express Beta, but thats a 2005 based editor, so likely thats why it wouldnt compile on my home machine. At work, I have VS6 as well as Visual Studio 2003 Enterprise Architect, so... I used VS6 to compile the working .exe.
I could probably explain how the code works, but honestly I didnt spend that much time going over it at work. Don't have much extra time there & don't have Visual Studio at home (yet). Wish I was a student again, then I could get the bare-bones student version of Visual Studio right cheap instead of the 800 bucks for the developer edition.
I'm sure you probably could embed a virus in it, but any decent virus scanner would pick it up, so... =) Now, as how to do that, I dunno. I havent fiddled with virus code since I was in school.
ROFL - a little hint of Eye's past life. So, shall we blame Michelangelo on you? :p
eyelleye
05-31-2005, 11:06 AM
ROTFL... nah. I mostly examined the code & collected virus sources... never actually bothered to write anything of my own or release anything. Thats not to say that I couldnt, just I don't feel the need to. =)
Powered by vBulletin™ Version 4.0.5 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.