Jump to content

Search the Community

Showing results for tags 'image'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Informatii generale
    • Anunturi importante
    • Bine ai venit
    • Proiecte RST
  • Sectiunea tehnica
    • Exploituri
    • Challenges (CTF)
    • Bug Bounty
    • Programare
    • Securitate web
    • Reverse engineering & exploit development
    • Mobile security
    • Sisteme de operare si discutii hardware
    • Electronica
    • Wireless Pentesting
    • Black SEO & monetizare
  • Tutoriale
    • Tutoriale in romana
    • Tutoriale in engleza
    • Tutoriale video
  • Programe
    • Programe hacking
    • Programe securitate
    • Programe utile
    • Free stuff
  • Discutii generale
    • RST Market
    • Off-topic
    • Discutii incepatori
    • Stiri securitate
    • Linkuri
    • Cosul de gunoi
  • Club Test's Topics
  • Clubul saraciei absolute's Topics
  • Chernobyl Hackers's Topics
  • Programming & Fun's Jokes / Funny pictures (programming related!)
  • Programming & Fun's Programming
  • Programming & Fun's Programming challenges
  • Bani pă net's Topics
  • Cumparaturi online's Topics
  • Web Development's Forum
  • 3D Print's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber


Skype


Location


Interests


Biography


Location


Interests


Occupation

Found 8 results

  1. Salut, Javascript se poate invata dintr-o singura imagine: https://github.com/coodict/javascript-in-one-pic
  2. Product Description Video to GIF is easy to use video to GIF converter with simple and friendly interface. Video to GIF well converts almost all popular video formats (such as AVI, MPEG, MP4, WMV, MKV, MOV, VOB, RMVB, etc) to not only animated GIF, but other commonly used image files (like JPG, BMP, TGA, PNG, TIF, etc). With ultrafast conversion speed and high quality, Video to GIF enables you to view animation as well as original video file easily. Video to GIF converter makes it possible for you to play video clips in GIF file. You can set 24 frame per second to get output GIF as same as original video or set 1 frame per second to get animated GIF with small size. What’s more, no plug-ins are required, you can publish the output GIF file on your web page by just using common HTML tag. Video to GIF is what exactly you desire. Convert video file like AVI, MPEG, MKV, MP4, WMV, MOV, and RM to animated GIF file. Keep original speed rate and resolution. Extract all frames of a video file into separate image files with ease. Images captured can be converted to all popular formats, such as JPG, GIF, BMP, PNG, etc. Add special effects (like Blue, Sharpen, Noise, Brighten, Invert, etc) to output GIF or other images. Convert video to GIF animation and other various image formats, including still GIF, JPEG, JPG, BMP, PNG, TGA, TIFF, ICO, and PCX. Adjust output rate. User can change the value of output rate (how many pictures per second) to control speed rate, which cannot be seen in other similar programs Convert video to a single image include multi-pictures with simple arrangement. Get output image file as same as original resolution or set a new size that you want. Video to GIF can be used as a video player with commonly used functions, like pause, stop, snapshot, etc. What’s more, it well supports all key video formats. -> Download <-Deal Expires in: EXPIRED!
  3. PowerISO is a powerful CD / DVD / BD disc image file processing tool that allows you to open, extract, burn, create, edit, compress, encrypt, split and convert ISO files, and mount ISO files with internal virtual drive. It can process almost all CD / DVD / BD disc image files (ISO, BIN, NRG, CDI, DAA, and so on). PowerISO provides an all-in-one solution for disc image management needs. Free PowerISO (100% discount) Promotia se termina in 15h.
  4. I receive crash dumps containing pirated antiviruses all the time, however I felt the need to blog about it for once because it's actually so often and just comical to me at this point. I also haven't blogged in a little while. I'm not really here to discuss the pros & cons of antivirus software, it's obvious. What I will say however is it's also obvious that for any software you install regardless of its intended job, you're increasing your attack surface. Given the fact that most antiviruses are granted complete come/go access to the kernel, have the highest privileges, have various kernel-mode drivers, etc, your surface is increased just that much more. Let's take a look at this crash dump (unfortunately only a Small Memory dump...): 2: kd> .bugcheck Bugcheck code 00000024 Arguments 00000000`001904fb fffff880`085866a8 fffff880`08585f00 fffff880`016b1d82 Right, so we have our bug check - NTFS_FILE_SYSTEM (0x24). Big hint, if you see this bug check on a crash dump from a user, chances are it's 50/60% (or more) the fault of either the one security application they have installed (whatever the actual problem with the application is), or user error as far as installing more than one security applications go. It's generally a bad idea to pigeonhole a bug check with a single problem (because it's ridiculous to do so), but I'd personally say over the years 0x24 has been much more of a security software issue than anything else. 2: kd> .exr fffff880`085866a8 ExceptionAddress: fffff880016b1d82 (Ntfs!NtfsRemoveHashEntry+0x00000000000000c2) ExceptionCode: c0000005 (Access violation) ExceptionFlags: 00000000 NumberParameters: 2 Parameter[0]: 0000000000000000 Parameter[1]: ffffffffffffffff Attempt to read from address ffffffffffffffff By taking a look at the exception record structure, we can see the direct reason for the exception being thrown that caused the actual crash was an access violation occurring in Ntfs!NtfsRemoveHashEntry. Now that we know why, let's take a look at the context record using the address from our 3rd parameter in the .bugcheck output. 2: kd> .cxr fffff880`08585f00 rax=0000000000000000 rbx=fffff8a00224e050 rcx=0001000000000000 rdx=0000000000000000 rsi=000000001fdefdd9 rdi=fffffa80049be358 rip=fffff880016b1d82 rsp=fffff880085868e0 rbp=00000000000001d9 r8=00000000000003b2 r9=0000000000000000 r10=00000000000003b2 r11=fffff88008586910 r12=0000000000000001 r13=0000000000000000 r14=0000000000000001 r15=fffff8a003533ed0 iopl=0 nv up ei pl nz na po nc cs=0010 ss=0018 ds=002b es=002b fs=0053 gs=002b efl=00010206 Ntfs!NtfsRemoveHashEntry+0xc2: fffff880`016b1d82 397110 cmp dword ptr [rcx+10h],esi ds:002b:00010000`00000010=???????? On the instruction regarding Ntfs!NtfsRemoveHashEntry, we can see it was comparing the esi register to the memory at address rcx+10. rcx looks pretty bogus, and just to confirm: 2: kd> !pte 0001000000000000 // Or !pte rcx VA 0001000000000000 PXE at FFFFF6FB7DBED000 PPE at FFFFF6FB7DA00000 PDE at FFFFF6FB40000000 PTE at FFFFF68000000000 Unable to get PXE FFFFF6FB7DBED000 WARNING: noncanonical VA, accesses will fault ! So here's the reason why the exception was thrown, it was noncanonical. Now that we've also instructed the debugger to use the context record as the register context, we can run a k(b,nL,whatever) to get a more detailed stack in our case - even with a Small Memory dump: 2: kd> k *** Stack trace for last set context - .thread/.cxr resets it Child-SP RetAddr Call Site fffff880`085868e0 fffff880`016b224f Ntfs!NtfsRemoveHashEntry+0xc2 fffff880`08586970 fffff880`016b0a24 Ntfs!NtfsDeleteNormalizedName+0x7f fffff880`085869a0 fffff880`016b4cdb Ntfs!NtfsDeleteScb+0x1f4 fffff880`085869e0 fffff880`0162e343 Ntfs!NtfsRemoveScb+0x5b fffff880`08586a20 fffff880`016b2a3c Ntfs!NtfsPrepareFcbForRemoval+0x53 fffff880`08586a50 fffff880`01635a52 Ntfs!NtfsTeardownStructures+0xdc fffff880`08586ad0 fffff880`016c22d3 Ntfs!NtfsDecrementCloseCounts+0xa2 fffff880`08586b10 fffff880`01714d32 Ntfs!NtfsCommonClose+0x353 fffff880`08586be0 fffff800`02ae1561 Ntfs!NtfsFspCloseInternal+0x186 fffff880`08586cb0 fffff800`02d740ca nt!ExpWorkerThread+0x111 fffff880`08586d40 fffff800`02ac8be6 nt!PspSystemThreadStartup+0x5a fffff880`08586d80 00000000`00000000 nt!KxStartSystemThread+0x16 Not going to put comments, but rather just talk about it. We were starting a system thread which turned out to be a worker thread (as we can see from the ExpWorkerThread function), and from then on go throughout various NT file system calls. Given the fact that it's a worker thread dealing with NTFS tells us we're likely dealing with a driver requiring delayed processing, etc. As we're going through various NTFS calls, we can see we're preparing the File Control Block (FCB) and Stream Control Block (SCB) for removal and deletion. This also tells us if anything, it's a driver working actively with/for the file system. Looking at the loaded modules list for any drivers actively working with the file system, what do we find? Hint: A lot of Symantec/Norton kernel-mode drivers 2: kd> lmvm SRTSP64 start end module name fffff880`082d4000 fffff880`08394000 SRTSP64 (deferred) Image path: SRTSP64.SYS Image name: SRTSP64.SYS Timestamp: Tue Mar 29 22:46:12 2011 Here is Symantec's x64 Real Time Storage Protection (SRTSP) driver. This driver is used by Symantec's Auto-Protect feature, which is what scans files under various conditions. You can expect to find this kernel-mode driver on any system with NIS installed, so what's the big deal? The timestamp/date on the driver itself is from March 29th 2011. The time of the bug check is: Debug session time: Tue Feb 3 23:57:58.466 2015 (UTC - 5:00) Okay, so we have a kernel-mode driver from/for Norton that's approximately as of this blog post 3.8 years old. That's.... bad. To give the user the absolute ultimate benefit of the doubt, I for a split-second thought that perhaps maybe Symantec really has a kernel-mode driver regarding RTP that's 3.8 years old. Surely there may be hundreds of vulnerabilities, but it's possible.. right? Wrong. 2: kd> vertarget Windows 7 Kernel Version 7601 (Service Pack 1) MP (4 procs) Free x64 Product: WinNt, suite: TerminalServer SingleUserTS Personal Built by: 7601.18700.amd64fre.win7sp1_gdr.141211-1742 It's a Windows 7 x64 system, so let's create a test environment really quick and install the latest trial version of NIS. Ah, that's much better. Unfortunately, that wasn't the only out of date kernel-mode driver regarding Symantec loaded on this particular system. Let's keep comparing: 2: kd> lmvm SYMDS64 start end module name fffff880`01279000 fffff880`012ea000 SYMDS64 (deferred) Image path: SYMDS64.SYS Image name: SYMDS64.SYS Timestamp: Tue Dec 07 19:16:58 2010 Symantec's x64 Data Store (SymDS) driver. 2: kd> lmvm SYMEFA64 start end module name fffff880`014f4000 fffff880`015d8000 SYMEFA64 (deferred) Image path: SYMEFA64.SYS Image name: SYMEFA64.SYS Timestamp: Sun Mar 13 23:20:58 2011 Symantec's x64 Extended File Attributes driver. 2: kd> lmvm SYMEVENT64x86 start end module name fffff880`01dbf000 fffff880`01df5000 SYMEVENT64x86 (deferred) Image path: SYMEVENT64x86.SYS Image name: SYMEVENT64x86.SYS Timestamp: Thu Mar 24 19:02:36 2011 Symantec's x64 SymEvent driver. 2: kd> lmvm SRTSPX64 start end module name fffff880`01c2d000 fffff880`01c43000 SRTSPX64 (deferred) Image path: SRTSPX64.SYS Image name: SRTSPX64.SYS Timestamp: Tue Mar 29 22:46:18 2011 Symantec's x64 Real Time Storage Protection (SRTSP - PEL) driver. 2: kd> lmvm SYMNETS start end module name fffff880`01d58000 fffff880`01dbf000 SYMNETS (deferred) Image path: SYMNETS.SYS Image name: SYMNETS.SYS Timestamp: Tue Apr 19 18:33:31 2011 Symantec's Network Security WFP driver. Overall, we can see that all of these Symantec/Norton kernel-mode drivers are not their latest versions. Given the fact that the user's system bug checked Feb 2015 and many of its kernel-mode drivers are 3.8 years (or older) old, we know it's pirated. Remove pirated Norton, crashes stop. Surprise surprise. Moral of the story: If you really are going to pirate an antivirus, be sure it's actually as up to date as it would be if you paid for it. If you're running an antivirus with kernel-mode drivers from 3.8> years old, the amount of vulnerabilities you're vulnerable to that were patched years ago is pretty high. You're also opening yourself up to becoming infected with old malware that was invalidated if not further developed if it relied on certain EOP (or other) exploits to get around active protection. Also, as you can see here, chances are you'll bug check considering you're also subject to ~3.8> year old driver bugs that have since been patched. You could alternatively just buy the antivirus. Crazy, I know. source
  5. Product Description Professional Video Watermark Software – Easy-to-use and Powerful Add Watermark to Video Files Whatever AVI, MP4, FLV, MOV, MPG, SWF or any other Video Formats! Add Text/Image/Shape Watermark to Videos Create Dynamic Watermark and Subtitle Effects Provide 200+ Free Watermark Materials Add Specific Effects to Video Support a wide range of video formats: AVI, MP4, FLV, MOV, MPG, etc. Protect Your Online Video Worry your shared videos might be used without your permission? Want to let viewers know the original author when people watching your shared videos? With Aoao Video Watermark Pro, you can add your copyright information to your videos to avoid the unauthorized use and ensure the ownership. Aoao Video Watermark Pro enables user to embed text, image, logo, sign (includes animated sign to your videos in batches. With friendly and easy-to-follow interface, user can feel extremely convenient to operate it. Up to 10X faster conversion speed makes you avoid waiting for a long time. Just with a few of clicks, you can watermark a batch of videos. All in all, Aoao Video Watermark Pro provides the excellent solution to protect your original work. Add Text Watermark to Video Provide rich settings (like opacity, rotation, font options, etc). Add copyright symbols C, R and TM to video. Support dynamic text watermark. Add Image Watermark to Video The image watermark can be logo, icon or any image files. Over 200 samples provided for free. Support adding animated GIF image as watermark. Add Shape Watermark to Video Create a line segment, curve, rectangle and oval shape to video, as well as an arrow. Common settings – color, width, opacity, rotation, etc Powerful Video Conversion Software Aoao Video Watermark Pro well supports all popular video formats on the Internet, including AVI, MPEG, WMV, MP4, MKV, 3GP, RM, FLV, SWF, etc. It also enables user to convert file to any format mentioned above. -> Download <- EXPIRED!
  6. Product Description Complete Windows Backup Software for PCs, Laptops, and Workstations. Backup: easily and safely save everything, including system, disk, partition and individual files. Restore: fast and reliable disaster recovery, supporting sector alignment and selective restoration. Clone: step-by-step transfer OS or upgrade hard drive without reinstalling Windows and applications. Utilities: command line backup, merge images, backup schemes, make bootable discs, VSS, etc. Backup Features: File Backup: back up your files and folders automatically or manually to ensure you don’t lose anything from now on. System Backup: one-click back up Windows, settings, applications and the files required for computer to boot. Disk & Partition Backups: flexibly choose entire hard drive or separate partitions to backup, including dynamic disk volumes. Schedule Backup: set up a schedule to back up your system and all files automatically, supporting daily, weekly, and monthly. Incremental & Differential Backups: on the basis of a full backup, save time and storage space by only backing up changed files. Backup Scheme: automatically delete the obsolete backup images based on specified value – the age and the number. Command Line Backup: make backups from command prompt or by creating a batch (.dat) file for unattended processing. Backup to Internal & External Storage Devices: support SCSI, IDE, SATA hard drives, external USB hard drives and all flash drives. Backup to CD/DVD: support CD-R/RW, DVD-R/RW, DVD+R/RW, BD-R. Backup to NAS/Share Network: set Network-Attached Storage (NAS) or share network as the destination path to easily backup. Restore Features: File Restore: Restore backed-up versions of files & folders that are lost, damaged, or changed accidentally, like emails, music, movies, etc. System Restore: Return your computer’s system files and programs to an earlier state when everything was working properly. Disk & Partition Restore: Completely recover the entire hard disk, partition or dynamic disk volume to the point you ever backed up. Selective File Restore: Just recover individual files what you need from disk & partition images without restoring the entire image to save time. Clone Features: Clone Disk: copy a hard drive to another one or solid state drive (SSD) without reinstalling Windows and applications. Clone Partition: create an exact duplication of your system or data partition, and transfer it to another place. Utilities & Tools: Merge Backup Images Combine full backup and its chained incremental backups into a single backup for better management. Check and Explore Images Verify data integrity of image file to ensure it can be restored successfully. Mount image file as a virtual partition to browse the contents in Windows Explorer. Encrypt and Compress Images Protect image file from unauthorized access with a password. Set the level of compression used for backing up process to save time or save storage space. Comment and Split Backups Add a comment for backup image so that it can be identified easily. Large backups can be split into multiple smaller image files or split to fit for fixed length media. Split and Delete Backups Large backups can be split into multiple smaller image files or split to fit for fixed length media. Delete a backup task or together with its backup image files. Export/Import Tasks and Logs Management Export all backup tasks stored in an XML file which can be imported later. View what operations the program has done and record the events that occur during a backup process. Email Notifications and VSS Send backup completion status to your email by using your own mail server or AOMEI SMTP server. Microsoft Volume Shadow (VSS) allows you to back up files that are in use, especially for open and locked files backup. Create Bootable Rescue Media Make Windows PE & Linux bootable CD/DVD or USB flash drive. It can be useful to recover if your computer cannot boot. Support manually add additional drivers when create Windows PE bootable media. YOU CAN ALSO TRY THESE FREEWARE: AOMEI PE Builder PE Builder - Create Bootable USB or CD/DVD based on Windows PE with AOMEI PE Builder This freeware helps you make a bootable environment based on Windows PE without installing AIK/WAIK easily, which integrates a set of tools that enables you to boot up your computer for easy maintenance and fast recovery tasks when the native system is corrupted or cannot be used. AOMEI OneKey Recovery One Key Recovery - Create a Factory Restore Partition with AOMEI OneKey Recovery This is also a freeware, as its name suggests, it can create a factory restore partition and ONE KEY backup system for all types of desktops and laptops. AOMEI PXE Boot Free PXE Boot Software and Network Booting Tool for Windows 8.1/8/7/XP/Vista This freeware aims to boot your multiple computers from an image via network. Its mode is Client/Server. It is easy to use. It also supports synchronous boot of multiple computers. One of the advantages is that it supports bootable micro-system created by you. -> Download <-Deal Expires in: EXPIRED!
  7. Methods for detecting affine image files forpix is a forensic program for identifying similar images that are no longer identical due to image manipulation. Hereinafter I will describe the technical background for the basic understanding of the need for such a program and how it works. From image files or files in general you can create so-called cryptologic hash values, which represent a kind of fingerprint of the file. In practice, these values have the characteristic of being unique. Therefore, if a hash value for a given image is known, the image can be uniquely identified in a large amount of other images by the hash value. The advantage of this fully automated procedure is that the semantic perception of the image content by a human is not required. This methodology is an integral and fundamental component of an effective forensic investigation. Due to the avalanche effect, which is a necessary feature of cryptologic hash functions, a minimum -for a human not to be recognized- change of the image causes a drastic change of the hash value. Although the original image and the manipulated image are almost identical, this will not apply to the hash values any more. Therefore the above mentioned application for identification is ineffective in the case of similar images. A method was applied that resolves the ineffectiveness of cryptologic hash values. It uses the fact that an offender is interested to preserve certain image content. In some degree, this will preserve the contrast as well as the color and frequency distribution. The method provides three algorithms to generate robust hash values of the mentioned image features. In case of a manipulation of the image, the hash values change either not at all or only moderately similar to the degree of manipulation. By comparing the hash values of a known image with those of a large quantity of other images, similar images can now be recognized fully automated. Download: http://rojak.de/le/forpix1.02_eng.7z Tutorial In order to launch the program on a Windows machine run the included batch file "forpix.bat". Otherwise, the program runs on all Java-capable machines with a 32 bit Java-VM. Just use the Java flag "-jar -Xmx1024m forpix.jar" in the command prompt. To perform a comparison following steps are necessary. The execution of the steps are very simple in practice. Creating an image database. Analyzing images of a seized media and import the images and hash values into the image database in one step. Analyzing a reference image and performing an automated image comparison in one step. As a result, you get for each reference image a list of the most similar images from the database. The very short tutorial: Create a database: menu "Database > Create ..." Choose a name along with a directory for the new database by pressing "Directory" Press "OK" Import images into the database: menu "Image > Import" Optionally you can insert your user name, case number/identifier, evidence number. Then choose the directory where the images were stored. Press "Start" Wait a moment... A message will be shown at the end. Press "OK" To compare a image with all images in the database: menu "Image > comparison..." Choose a reference image by pressing "file" to open the reference image file. For comparison press "Start". Wait a moment... A message will be shown at the end. Press "OK" After that you will see a list of images, similar to the reference image. To show each image just single click on each entry in the list. To show the reference image just click "Reference Image" in the menu bar. Read more: forpix | martin rojak
  8. Screen Dupa cum spune si titlul, acest soft ascunde text in imagini, pentru mai multe detalii vezi comentariul sursei. L-am pus aici ca sa ramana mai mult timp "vizibil", daca e vreo problema il mut la stuff. In 3 zile, 300 linii de cod, m-am gandit sa ma rezolv cat de cat cu atestatul si cum iubesc sursa libera si impartasirea ei pun la dispozitie asta: http://codepad.org/hNzxFzFT #! /usr/bin/env python # Text In Image # 02.01.2012 cmiN # # This is a simple GUI script which can hide text in pictures # using least significant bit method. # Also the input text can be encrypted and the output can be decrypted too # with a symmetric key using AES. # Writing is done directly on input image so be careful with certain extensions # because the output will always have the BMP format. # # Contact: cmin764@yahoo/gmail.com from Tkinter import * # widgets's classes from tkFileDialog import askopenfilename # get file name from tkMessageBox import showerror, showinfo # user dialog from PIL import Image # image converting from Crypto.Cipher import AES # text cipher class Engine: """ Code for processing the image. Separated from GUI. """ def __init__(self): """ Initialize parameters. """ self.ext = "bmp" # save format self.name = None # save name self.path = None # save path self.im = None # image object, read and write self.generator = None # get locations to write/read bits self.useAES = None # use it or not self.aes = None # AES object self.data = None # data to be written to image self.width = None # image width self.height = None # image height self.tmp = None # last string, used when key changes def binary(self, nr, size): """ Get 1&0 representation. """ return bin(nr).replace("0b", "").zfill(size * 8) def path_name(self, path): """ Split a file path in path and name. """ ind = path.rfind("/") + 1 return (path[:ind], path[ind:]) def set_generator(self): """ Useful for resetting. """ self.generator = ((wp, hp, ch) for wp in xrange(self.width) # WxHxC for hp in xrange(self.height) for ch in xrange(3)) def load(self, path): """ Load image. """ self.im = Image.open(path) (self.width, self.height) = self.im.size (self.path, self.name) = self.path_name(path) return self.width * self.height * 3 # total useful bytes def parse_key(self, key): """ If key exists make an AES object from it. """ if not key: self.aes = None # empty key == no encryption return self.parse_string(self.tmp) # must return size (see the next return) key.decode() # test availability size = len(key) for padding in (16, 24, 32): # fixed key size if size <= padding: break key += chr(0) * (padding - size) self.aes = AES.new(key) return self.parse_string(self.tmp) # if key changes you must update string def parse_string(self, string): """ Convert to bitstring. """ if not string: # without string can't start the process self.tmp = None self.data = None return 0 string.decode() # test availability self.tmp = string if self.useAES and self.aes: # encrypt it string += chr(0) * ((16 - len(string) % 16) % 16) # multiple of 16 string string = self.aes.encrypt(string) string = str().join([self.binary(ord(x), 1) for x in string]) # convert every char in a set of 8 bits size = self.binary(len(string), 4) # get binary representation of string's length in 4 bytes self.data = size + string return len(self.data) def write(self): """ Write using LSB. """ self.set_generator() # rearm for bit in self.data: (wp, hp, ch) = self.generator.next() # get next position values = list(self.im.getpixel((wp, hp))) # retrieve its values tmp = self.binary(values[ch], 1) # convert one of them values[ch] = int(tmp[:7] + bit, 2) # alter that channel self.im.putpixel((wp, hp), tuple(values)) # put it back self.im.save(self.path + self.name, format=self.ext) # save the new output def read(self): """ Read from every LSB. """ self.set_generator() # rearm total = self.width * self.height * 3 if total < 32: raise Exception("Text not found.") size = chunk = string = str() i = 0 # for(i=0; true; ++i) while True: (wp, hp, ch) = self.generator.next() # i byte values = self.im.getpixel((wp, hp)) tmp = self.binary(values[ch], 1) if i < 32: # it's lame but I prefer string/bitset size += tmp[7] if i == 31: size = int(size, 2) if size < 1 or (size + 32) > total: raise Exception("Text not found.") elif i < size + 32: chunk += tmp[7] if len(chunk) == 8: string += chr(int(chunk, 2)) chunk = str() else: break i += 1 if self.useAES and self.aes: if len(string) % 16 != 0: raise Exception("Text not encrypted.") string = self.aes.decrypt(string).rstrip(chr(0)) string.decode() # raise an exception if invalid return string class GUI(Frame): """ Main window, inherited from Frame. Here we put our widgets and set their behavior. """ def __init__(self, master=None, margin=30): """ Same as Frame's constructor. """ Frame.__init__(self, master, padx=margin, pady=margin) self.grid() self.widgets() self.behavior() def widgets(self): """ Build and grid widgets. """ # ---- create variables ---- self.totalBytes = IntVar() # depends on image size self.usedBytes = IntVar() # how many of them are used self.textStatus = StringVar() # used per total bytes self.useEncryption = IntVar() # 0-plain 1-AES self.mode = IntVar() # 0-read 1-write self.textOpt = dict() # text last config self.keyOpt = dict() # key last config self.loaded = False # image loaded or not # ---- create widgets ---- self.label = Label(self, textvariable=self.textStatus) self.about = Label(self, text="About", fg="blue") self.text = Text(self, width=30, height=5, fg="grey") self.scrollbar = Scrollbar(self, orient="vertical", command=self.text.yview) self.loadButton = Button(self, text="Load", width=5, command=lambda: self.action("load")) self.readRadio = Radiobutton(self, text="Read", variable=self.mode, value=0, command=self.set_state) self.checkButton = Checkbutton(self, text="Use AES", variable=self.useEncryption, onvalue=1, offvalue=0, command=self.set_state) self.startButton = Button(self, text="Start", width=5, state="disabled", command=lambda: self.action("start")) self.writeRadio = Radiobutton(self, text="Write", variable=self.mode, value=1, command=self.set_state) self.keyEntry = Entry(self, width=10, fg="grey", show="*") # ---- show widgets ---- self.label.grid(row=0, column=0, columnspan=2, sticky="w") self.about.grid(row=0, column=2, sticky="e") self.text.grid(row=1, column=0, rowspan=3, columnspan=3) self.scrollbar.grid(row=1, column=3, rowspan=3, sticky="ns") self.loadButton.grid(row=4, column=0, sticky="w", pady=5) self.readRadio.grid(row=4, column=1) self.checkButton.grid(row=4, column=2, sticky="e") self.startButton.grid(row=5, column=0, sticky="w") self.writeRadio.grid(row=5, column=1) self.keyEntry.grid(row=5, column=2, sticky="e") def behavior(self): """ Customize widgets. """ self.text.config(yscrollcommand=self.scrollbar.set) self.text.insert(0.0, "Text here") self.keyEntry.insert(0, "Key here") self.text.bind("<Button>", self.handle_event) self.text.bind("<KeyRelease>", self.handle_event) self.keyEntry.bind("<Button>", self.handle_event) self.keyEntry.bind("<KeyRelease>", self.handle_event) self.textOpt = self.get_opt(self.text) self.keyOpt = self.get_opt(self.keyEntry) self.about.bind("<Button>", self.handle_event) self.set_state() def action(self, arg): """ What every button triggers. """ if arg == "load": fileTypes = [("BMP", "*.bmp"), ("JPEG", ("*.jpeg", "*.jpg")), ("PNG", "*.png"), ("All Files", "*.*")] path = askopenfilename(parent=self, title="Open image", filetypes=fileTypes) if path != "": try: self.totalBytes.set(app.load(path)) except IOError as msg: showerror("Error", str(msg).capitalize().strip(".") + ".") # some formatting else: self.loaded = True self.set_state() self.master.title("Text In Image - %s" % app.name) # update name in title elif arg == "start": if self.mode.get(): try: app.write() except Exception as msg: showerror("Error", str(msg).capitalize().strip(".") + ".") else: showinfo("Info", "Done.") else: try: string = app.read() except UnicodeError: showerror("Error", "Text not found or wrong key.") except Exception as msg: showerror("Error", str(msg).capitalize().strip(".") + ".") else: self.text.config(state="normal") self.textOpt["fg"] = "black" # touched self.text.delete(0.0, END) self.text.insert(0.0, string) self.text.config(state="disabled") self.usedBytes.set(app.parse_string(string)) self.set_status() showinfo("Info", "Done.") def set_status(self): """ Get used per total bytes. """ string = "%9.3f%s/%9.3f%s" unit1 = unit2 = "b" used = self.usedBytes.get() total = self.totalBytes.get() if used > total: self.label.config(fg="red") else: self.label.config(fg="black") if used > 999999: unit1 = "Mb" used /= 1000000.0 elif used > 999: unit1 = "Kb" used /= 1000.0 if total > 999999: unit2 = "Mb" total /= 1000000.0 elif total > 999: unit2 = "Kb" total /= 1000.0 self.textStatus.set(string % (used, unit1, total, unit2)) def get_opt(self, widget): """ Get some options from a widget then pack them. """ opt = dict() opt["state"] = widget["state"] opt["fg"] = widget["fg"] opt["bg"] = widget["bg"] return opt def set_state(self): """ Enable or disable a widget according to option selected. """ if self.mode.get(): # write self.text.config(**self.textOpt) else: self.text.config(state="disabled", bg="lightgrey", fg="darkgrey") if self.useEncryption.get(): # use AES self.keyEntry.config(**self.keyOpt) app.useAES = True else: self.keyEntry.config(state="disabled") app.useAES = False length = app.parse_string(app.tmp) self.usedBytes.set(length) self.set_status() if self.loaded: # a file is loaded if self.mode.get() == 0: # read mode ok = True elif app.data != None and self.usedBytes.get() <= self.totalBytes.get(): ok = True else: ok = False else: ok = False # no file loaded if ok: self.startButton.config(state="normal") else: self.startButton.config(state="disabled") def handle_event(self, event): """ Handle events for specific widgets. """ if event.widget is self.text and self.text["state"] == "normal": if self.text["fg"] == "grey": self.text.delete(0.0, END) self.textOpt["fg"] = self.text["fg"] = "black" string = self.text.get(0.0, END).strip() try: length = app.parse_string(string) except UnicodeError: showerror("Error", "Invalid text.") else: self.usedBytes.set(length) self.set_state() elif event.widget is self.keyEntry and self.keyEntry["state"] == "normal": if self.keyEntry["fg"] == "grey": self.keyEntry.delete(0, END) self.keyOpt["fg"] = self.keyEntry["fg"] = "black" key = self.keyEntry.get()[:32] # first 32 (max size is 32) try: length = app.parse_key(key) except UnicodeError: showerror("Error", "Invalid key.") else: self.usedBytes.set(length) self.set_state() elif event.widget is self.about: showinfo("About", "Hide text, which can be encrypted with AES, in pictures, preferably bitmaps. Coded by cmiN. Visit rstcenter.com") if __name__ == "__main__": app = Engine() # core root = Tk() # toplevel root.title("Text In Image") root.maxsize(350, 250) root.iconbitmap("tii.ico") # comment if you don't have one GUI(root) root.mainloop() Testat pe windows, fedora si slackware, merge perfect, dar sa cititi comentariul principal. Aveti nevoie de python 2.7, PIL si pycrypto. Pe linux de obicei sunt preinstalate. Versiune portabila: box gamefront Updated: 14.01.2012
×
×
  • Create New...