Dr. Dobb's Journal - October 2007 - (Page 27) Listing One def square(matrix, n, d): # returns a square slice of dim d from a matrix # n - square number maxX = len(matrix[0]) maxY = len(matrix[:,0]) xsquares = maxX/d ysquares = maxY/d dy, dx = divmod(n, xsquares) xslc = dx * d yslc = dy * d return matrix[xslc:xslc+d, yslc:yslc+d] Listing Two def writesquare(matrix, square, n): # writes a square of dim d into a bigger matrix # n - square number # returns the matrix with the overwritten sqaure maxX = len(matrix[0]) maxY = len(matrix[:,0]) sqX = len(square[0]) sqY = len(square[:,0]) xsquares = maxX/sqX ysquares = maxY/sqY dy, dx = divmod(n, xsquares) xslc = dx * sqX yslc = dy * sqY matrix[xslc:xslc+sqX, yslc:yslc+sqY] = square return matrix continued from page 25 A 24-bit true-color image consists of red, green, and blue (RGB). The human visual system seems sensitive to green variations and less sensitive to blue ones. Therefore, I adopt the following order in embedding data: I start with the MSB of every constituent color, then move to the next plane until all the embedding information is written. The order of the color components is blue, red, green. Though the embedding scheme is known for all images, it does not have to be communicated to the receiving party. The receiver only has to divide the image into color components, then bit-planes and regions. Afterwards, all regions having a complexity above the predefined threshold are checked for data. If a region has errors and is not identified by its complexity (or if the sequence number was altered), the receiver misses the block. But it is possible to guess which region should contain data (see Listing Seven, available electronically; see “Resource Center,” page 5). ded into an 8-bit grayscale image (traditionally called a “vessel”) using the modified BPCS scheme. Finally, the dealer electronically sends the images with embedded data to the participants. Participants process the received image (also based on the modified BPCS scheme), obtain the embedded share as a binary image, and print the binary image on a transparency. As soon as the participants come together, they can visually reconstruct the secret message by carefully superimposing the two transparencies. This model follows the block diagram in Figure 4. Though separated in practice, for simplicity, Figure 4 illustrates the embed/extract process together: only the steganographic method for an 8-bit grayscale image is treated. Figure 5 presents a general view considering the modality the data is embedded into the vessels. The Implementation To illustrate this model, I wrote an application using Python, the Python Imaging Library (PIL) (www.pythonware.com/products/pil/), and the numarray package for Python (www.stsci.edu/resources/software_hardware/numarray). PIL adds image-processing capabilities to Python and processes a range of image formats. numarray lets Python efficiently manipulate large numeric arrays, similar to Matlab, IDL, or Octave. There is a common convention in processing binary (black-and-white) images: If any October 2007 l www.ddj.com l Dr. Dobb’s Journal The Model A possible scenario for the proposed model involves a “dealer” and “participants” to the scheme. The dealer chooses a secret message represented as a binary black-andwhite image and applies a (2,2) visualcryptography scheme on the secret message, obtaining the two corresponding shares. Every share is individually embed- 27 http://www.pythonware.com/products/pil/ http://www.stsci.edu/resources/software_hardware/numarray http://www.stsci.edu/resources/software_hardware/numarray http://www.perforce.com http://www.ddj.com
Table of Contents Feed for the Digital Edition of Dr. Dobb's Journal - October 2007 Cover Contents Hmmmm Alia Vox Developer Diaries Developer’s Notebook AI: It’s OK Again! Conversations Visual Cryptography and Bit-Plane Complexity Segmentation Inside the Windows Vista Disk Encryption Algorithm Memory-Aware Components Software and the Core Description Process Logging In C++ Effective Concurrency The Agile Edge Swaine’s Flames Dr. Dobb's Journal - October 2007 Dr. Dobb's Journal - October 2007 - Cover (Page Cover1) Dr. Dobb's Journal - October 2007 - Cover (Page Cover2) Dr. Dobb's Journal - October 2007 - Cover (Page 1) Dr. Dobb's Journal - October 2007 - Cover (Page 2) Dr. Dobb's Journal - October 2007 - Cover (Page 3) Dr. Dobb's Journal - October 2007 - Contents (Page 4) Dr. Dobb's Journal - October 2007 - Contents (Page 5) Dr. Dobb's Journal - October 2007 - Hmmmm (Page 6) Dr. Dobb's Journal - October 2007 - Hmmmm (Page 7) Dr. Dobb's Journal - October 2007 - Hmmmm (Page 8) Dr. Dobb's Journal - October 2007 - Hmmmm (Page 9) Dr. Dobb's Journal - October 2007 - Alia Vox (Page 10) Dr. Dobb's Journal - October 2007 - Alia Vox (Page 11) Dr. Dobb's Journal - October 2007 - Developer Diaries (Page 12) Dr. Dobb's Journal - October 2007 - Developer Diaries (Page 13) Dr. Dobb's Journal - October 2007 - Developer’s Notebook (Page 14) Dr. Dobb's Journal - October 2007 - Developer’s Notebook (Page 15) Dr. Dobb's Journal - October 2007 - AI: It’s OK Again! (Page 16) Dr. Dobb's Journal - October 2007 - AI: It’s OK Again! (Page 17) Dr. Dobb's Journal - October 2007 - AI: It’s OK Again! (Page 18) Dr. Dobb's Journal - October 2007 - AI: It’s OK Again! (Page 19) Dr. Dobb's Journal - October 2007 - Conversations (Page 20) Dr. Dobb's Journal - October 2007 - Conversations (Page 21) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 22) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 23) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 24) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 25) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 26) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 27) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 28) Dr. Dobb's Journal - October 2007 - Visual Cryptography and Bit-Plane Complexity Segmentation (Page 29) Dr. Dobb's Journal - October 2007 - Inside the Windows Vista Disk Encryption Algorithm (Page 30) Dr. Dobb's Journal - October 2007 - Inside the Windows Vista Disk Encryption Algorithm (Page 31) Dr. Dobb's Journal - October 2007 - Inside the Windows Vista Disk Encryption Algorithm (Page 32) Dr. Dobb's Journal - October 2007 - Inside the Windows Vista Disk Encryption Algorithm (Page 33) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 34) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 35) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 36) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 37) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 38) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 39) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 40) Dr. Dobb's Journal - October 2007 - Memory-Aware Components (Page 41) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 42) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 43) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 44) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 45) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 46) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 47) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 48) Dr. Dobb's Journal - October 2007 - Software and the Core Description Process (Page 49) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 50) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 51) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 52) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 53) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 54) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 55) Dr. Dobb's Journal - October 2007 - Logging In C++ (Page 56) Dr. Dobb's Journal - October 2007 - Effective Concurrency (Page 57) Dr. Dobb's Journal - October 2007 - Effective Concurrency (Page 58) Dr. Dobb's Journal - October 2007 - Effective Concurrency (Page 59) Dr. Dobb's Journal - October 2007 - The Agile Edge (Page 60) Dr. Dobb's Journal - October 2007 - The Agile Edge (Page 61) Dr. Dobb's Journal - October 2007 - The Agile Edge (Page 62) Dr. Dobb's Journal - October 2007 - The Agile Edge (Page 63) Dr. Dobb's Journal - October 2007 - Swaine’s Flames (Page 64) Dr. Dobb's Journal - October 2007 - Swaine’s Flames (Page Cover3) Dr. Dobb's Journal - October 2007 - Swaine’s Flames (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.