criticalmaking.com

DRM in the physical word – Control the usage

March 11, 2009inf2241_classfi22410

On March 4, 2009 we started building our physical DRM system. The idea is to control the physical artefact and its usage.

We want to restrict the usage of books within the controlled environment of an library. The books in libraries are today often equiped with RFID tags. These tags are used to detect if somebody tries to take a book out of the library without checking the book out. We want to use the RFID tags to control the copying of the book withing the library. Of course this setting has a limitation. It is still possible to borrow the book and copy it somewhere else. But every copying machine could be equipped with such a technology.

But back to the idea. We want an RFID reader in the copying machine. This allows to detect which book is about to be copied. If the user presses the copy button our system looks up the book, which is identified through an RFID signature, in a database and decides if the copying is permitted. The database could also carry the information how many pages can be copied.

The amount of pages allowed for copying could be set by the librarian uppon request. It could also be determined as a quota. A percentage of pages allowed to being copied depending on the overall pagecount.

Our prototype uses an RFID reader on a bread board. The RFID reader is power and controlled through the Arduino board. We placed this within a flat bed scanner (under the glass) and used the built in button of the scanner to start a copy process. We want to place a camera above the glass that takes a picture of the book. The book has to be place the other way around on the scanner. Once the button is pressed the RFID information of the book is compared with a file on the controlling laptop (connected via serial console). Only if the identifyer of the book is in the file and has a copycount bigger than zero the laptop will take the picture.

The DRM enforcer 1.0 - The publisher dream

The DRM enforcer 1.0 – The publisher dream

Well we did this project not to help the publishing industry to enforce IP laws. Even with our device there will always be ways to circumvent such technology (take a digital camera and the book can be scanned). It is more a way to explore digital DRM in the physical world. Digital DRM can also be circumvented, but the law disallows this. DRM and circumvention laws try to frustrate hackers and disencourage the copying of digital content. In the end they frustrate the user who payed for the usage of the digital content. The user can not use and posses his property in the same way a user could posses a physical property.

Code for anyone who wishes to take a look (1st part is python, 2nd is Wiring for Arduino):

#!/usr/bin/env python
import serial
import sqlite3
import re
import os
import datetime
re_id=re.compile(r'[0-9A-Z]{10}')
re_snap=re.compile(r'snap!')
con=sqlite3.connect('ids.sql')
count = int
s = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
#s = open('ids.txt', 'r')
while 1:
	item = s.readline()
	for id in re_id.findall(item):
		count = con.execute("SELECT count from ids where id = '%s';" %(id)).fetchone()
		try:
			count = int(count[0])
			print id, count
		except:
			count = 0
			print id, count
	for snap in re_snap.findall(item):
		count = int(count) - 1
		if count > 0:
			con.execute("UPDATE ids set count = '%s' WHERE id = '%s';" %(count,id))
			con.commit()
			os.popen('uvccapture -x960 -y720 ~/-o%s-%s.jpg' %(id,count))
			os.popen4('eog ~/%s-%s.jpg' %(id,count))
		if count == 0:
			os.popen4('eog ~/fail.jpg')
		if count < 0:
			os.popen4('eog ~/fail.jpg')
		

Arduino Sketch:

// RFID reader ID-12 for Arduino
// Based on code by BARRAGAN
// and code from HC Gilje – http://hcgilje.wordpress.com/resources/rfid_id12_tagreader/
// Modified for Arudino by djmatic
// Modified for ID-12 and checksum by Martijn The – http://www.martijnthe.nl/
//
// Use the drawings from HC Gilje to wire up the ID-12.
// Remark: disconnect the rx serial wire to the ID-12 when uploading the sketch

int controlPin = 2;
int pushPin = 12;
int ledPin = 13;
int state = HIGH;
int reading;
int previous = LOW;
long time = 0;
long debounce = 200;

void setup() {
pinMode(controlPin, OUTPUT);
pinMode(pushPin, INPUT);
Serial.begin(9600); // connect to the serial port
}

void loop () {
digitalWrite(controlPin, HIGH);
byte i = 0;
byte val = 0;
byte code[6];
byte checksum = 0;
byte bytesread = 0;
byte tempbyte = 0;

if(Serial.available() > 0) {
if((val = Serial.read()) == 2) { // check for header
bytesread = 0;
while (bytesread 0) {
val = Serial.read();
if((val == 0x0D)||(val == 0x0A)||(val == 0x03)||(val == 0x02)) { // if header or stop bytes before the 10 digit reading
break; // stop reading
}

// Do Ascii/Hex conversion:
if ((val >= ‘0’) && (val = ‘A’) && (val > 1] = (val | (tempbyte <> 1 != 5) { // If we’re at the checksum byte,
checksum ^= code[bytesread >> 1]; // Calculate the checksum… (XOR)
};
} else {
tempbyte = val; // Store the first hex digit first…
};

bytesread++; // ready to read next digit
}
}

// Output to Serial:

if (bytesread == 12) { // if 12 digit read is complete
Serial.print(“5-byte code: “);
for (i=0; i<5; i++) {
if (code[i] debounce) {
// … invert the output
if (state == HIGH)
state = LOW;
else
state = HIGH;
Serial.print(“snap!”);

// … and remember when the last button press was
time = millis();
}

digitalWrite(ledPin, state);

previous = reading;

}

You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

Leave a reply

Follow Us