0

I have raw data from an email that contains a jpeg. I can see the jpeg portion, but how do I take that data and create the jpeg so I can see the photo?

Raw data looks like this:

------=_NextPart_000_001F_01CF11D6.5A125C60
Content-Type: image/jpeg;
    name="image001.jpg"
Content-Transfer-Encoding: base64
Content-ID: <image001.jpg@01CF11D5.792185A0>

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAARACcDASIA
AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA
p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA
d/8AK6/Emniby9yTe97Xb6Nd1pezfk7amvF4guSYB5Mdx527y/JDZfb94YPTHHXrmimaDolzDepe
XkU0RhRkjWa6MzMWxkk9BgDAA9eaK5KrpRlaKv8A15HoYeNepDmlJr5f5q+501RXP/HpN/uN/Kii
uaO52y+FnJeEP+Rbuf8Ar4P867EdBRRXVjf40vU4Ms/3eHov1FooorkPRP/Z

------=_NextPart_000_001F_01CF11D6.5A125C60--

this is not the complete data, but this is what I see. I need to take that data and turn it into a viewable photo. Does anyone know how? can this be done?

d4d4u1
  • 5
  • 2
  • 8

2 Answers2

0

I do not know exactly but according to this it says it is it is in Base 64, so try to just copy and paste the entirety of the code into a free online decoder like this one --> http://www.freeformatter.com/base64-encoder.html

This also also would send it back to you as a file which you should be able to save as a .jpg

Let me know if the full code works.

TheGoblinPopper
  • 149
  • 1
  • 3
  • 12
  • I was looking for something not online, but thank you anyway. – d4d4u1 Jan 16 '14 at 20:26
  • i dont think I understand your question then... you want something to download to do this, a program in a language you know, or....? – TheGoblinPopper Jan 20 '14 at 08:20
  • Sorry for the vagueness of my question. I would like to know if there is a snippet of code that I can add to my own internal site, that I can drop in the raw data, like above, and click on a button and display the image. I don't mind coding it myself, but I can't do it online as who knows who else will see the images. and if the image is personal in nature I don't want that on the web. – d4d4u1 Jan 21 '14 at 16:43
  • I have been tasked with inspecting a persons email that has been acting questionably in the eyes of upper management, and they want to know if he is sending company data, via photos attached to emails, out of the building. They want to do it without changing his password and raising any suspicions from him that this is happening. – d4d4u1 Jan 21 '14 at 16:57
  • I can code in VB, vb script, java, java script, C#, C, C++, and a few others. I would prefer VB or C#, but can use any other. I can't seem to find one that works. – d4d4u1 Jan 21 '14 at 17:27
0

As per MSDN page Convert.FromBase64String Method in VB.Net, use:

Public Shared Function FromBase64String(s As String) As Byte()

for example:

Dim base64Encoded As String = "YmFzZTY0IGVuY29kZWQgc3RyaW5n"
Dim data() As Byte
data = System.Convert.FromBase64String(base64Encoded)

then save data to a file.

Example is from here

Cameron
  • 56
  • 3