Some ideas about classified documents labeling and QR codes

It is obvious that in order to properly protect something, you first need to know: what you possess and what value it brings to you. This principle also applies to information that – especially today –  in companies of every industry is undoubtedly the driving force of business. As such, like all company assets, the information requires protection by the means and in a manner closely related to the level of classification.

Information resources must therefore be inventoried and classified according to the classification standards applicable to the company. Then they should be protected to prevent leakage of sensitive information to the outside of the company.

But today I don’t want to focus comprehensively on the whole problem, because in this case probably I would have to write a book about it. So I’ll confine my consideration to only one aspect: labeling of classified documents by the best possible way to facilitate their management.

In my opinion, an excellent way of classified documents labeling is to place QR (Quick Response Code) in their headers or footers. Such labels can include not only the classification clause, but also – for example – some information about the owner of the document, the date of its preparation, checksum, its identifier in the database of classified documents  etc. QR Codes can be easily scanned and decoded. You don’t need to have any kind of professional, dedicated scanners. Instead of them you can use your smartphone equipped with such software as for instance QRafter or similar.

How to generate QR codes with the classification clauses?

To develop a pretty elegant solution, there are no great effort and a big budget needed. Your (as always) excellent mind and some basic coding skills will be quite enough.

What I wanted to show now is just a prototype, and therefore does not pretend to be a turnkey solution.  However It can be considered as a sort of springboard (inspiration?) to some more useful ideas and solutions.

Script developed by me, which I put below, was written in Ruby. To build its graphical user interface I used the GTK2 library. To execute it you need of course the Ruby language interpreter. In Linux and MacOS it is installed by default. The best distribution for Windows is available at http://rubyinstaller.org/. The script requires the GTK2  and rqrcode_png libraries. Both can be installed very simply by issuing the following commands on the operating systems shell prompt:

gem install gtk2

and

gem install rqrcode_png

Here is the script code:

# encoding UTF-8
require 'rqrcode_png'
require 'gtk2'

def message_box(message)
   dialog = Gtk::Dialog.new("Message",
   $main_application_window,
   Gtk::Dialog::DESTROY_WITH_PARENT,
        [ Gtk::Stock::OK, Gtk::Dialog::RESPONSE_NONE ])
   # Dialog box should be destroyed when the user responds.
   dialog.signal_connect('response') { dialog.destroy }
   dialog.vbox.add(Gtk::Label.new(message))
   dialog.show_all
end

def qr_code_generate (text, resolution, size)
   begin
      qr = RQRCode::QRCode.new( text, :size =>size, :level => :h )
      png = qr.to_img 
      png.resize(resolution, resolution).save("your_qrcode.png")
      message_box("Your QRcode is saved into the: your_qr_code.png file in the current directory\n")
   rescue => e
      message_box("Problem, problem.... See the details at the console.\n")
      p e.message
      p e.backtrace
   end
end

window = Gtk::Window.new("QRCodeGen by Janusz Nawrat (2013)")
window.resizable = false
window.border_width = 10
window.signal_connect('destroy') { Gtk.main_quit }
window.set_size_request(350, 450)

frame = Gtk::Frame.new("Text to generate QRcode from...")
frame.set_shadow_type( Gtk::SHADOW_ETCHED_OUT )

textview = Gtk::TextView.new
textview.buffer.text = "Input your text here..."
textview.set_size_request(-1, 280)

scrolledw = Gtk::ScrolledWindow.new
scrolledw.border_width = 5
scrolledw.add(textview)
scrolledw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS)

frame.add(scrolledw)

action_button = Gtk::Button.new("DO IT NOW")
clear_button = Gtk::Button.new("CLEAR")
cancel_button = Gtk::Button.new("Quit")

action_button.signal_connect('clicked') {
   qr_code_generate(textview.buffer.text, $resolution.value.to_i, $size.value.to_i)
   textview.buffer.text = "\n" + textview.buffer.text
   qrcode_picture = Gdk::Pixbuf.new("your_qrcode.png")
   iter = textview.buffer.get_iter_at_line(0)
   textview.buffer.insert_pixbuf(iter, qrcode_picture)
}

clear_button.signal_connect('clicked') {
   textview.buffer.text = ""
}

cancel_button.signal_connect('clicked') {
   Gtk.main_quit
}

param_frame = Gtk::Frame.new("QR Code Resolution")
param_frame.set_shadow_type( Gtk::SHADOW_ETCHED_OUT )

resol_label = Gtk::Label.new("QR Code Resolution: ")
$resolution = Gtk::HScale.new(80, 180, 20)
$resolution.value_pos = Gtk::POS_LEFT

size_frame = Gtk::Frame.new("QR Code Size")
size_frame.set_shadow_type( Gtk::SHADOW_ETCHED_OUT )
size_label = Gtk::Label.new("QR Code Size: ")
$size = Gtk::SpinButton.new(6, 20, 1)

hbox = Gtk::HBox.new(true, 1)
hbox.pack_start(action_button, true, true, 0)
hbox.pack_start(clear_button, true, true, 0)
hbox.pack_start(cancel_button, true, true, 0)

param_hbox = Gtk::HBox.new(true, 1)
param_hbox.pack_start(resol_label, true, true, 0)
param_hbox.pack_start($resolution, true, true, 0)
param_frame.add(param_hbox)

size_hbox = Gtk::HBox.new(true, 1)
size_hbox.pack_start(size_label, true, true, 0)
size_hbox.pack_start($size, true, true, 0)
size_frame.add(size_hbox)

vbox = Gtk::VBox.new(false, 1)
vbox.pack_start(frame, true, true, 0)
vbox.pack_start(param_frame, true, true, 0)
vbox.pack_start(size_frame, true, true, 0)
vbox.pack_start(hbox, false, false, 0)

window.add(vbox)
window.show_all
Gtk.main

…and the screenshot:

qr-code-gen_screen

I mentioned earlier about more useful applications of QR codes. I can easily imagine that a little development made on printer driver or spooler scripting code could allow us to generate such codes fully automatically and transparently to the user. However, before you start experimenting, remember that we cannot do these experiments in production environments and every solution before its production implementation  must be reliable and thoroughly tested to let the business function properly, without unnecessary interruptions.

I hope I was able to inspire you a little bit.

Thank you for your attention and wait for the next article on my blog!

Informacje Janusz Nawrat
Just ordinary man who likes thinking...

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Log Out / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Log Out / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Log Out / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Log Out / Zmień )

Connecting to %s

TOMASZ WEŁNA

artysta grafik | wykładowca

PRACOWNIA OKO

Szkoła Rysunku Malarstwa i Grafiki DR TOMASZA WEŁNY | KRAKÓW | Plac Matejki 10 | tel 691 81 75 74

Piękno neurobiologii

Blog Jerzego Vetulaniego

Teoria muzyki, zasady muzyki, podstawy muzyki

Teoria muzyki, zasady muzyki, podstawy muzyki - czyli to co każdy amator muzyki wiedzieć powinien :)

Personal Development & Inspirations

Przemyślenia i refleksje, którymi warto się podzielić (blog by Janusz Nawrat)

Business IT Cooperation Platform

Biznes i IT - dwa światy, które muszą współdziałać

%d bloggers like this: