Arduino Due + BT Dongle

Source Code:  USBHost-Due-BT.tar.bz2

The Arduino Due uses an Atmel SAM3X8E microcontroller, and is capable of functioning as a USB host.  Well, sort of:  The USB Host library supplied with the Arduino IDE is apparently still a work in progress, so that it isn’t possible to attach a Bluetooth dongle and make it function as a BT serial adapter.

 

A Beaglebone and an Arduino epoxied to an aluminum plate.
A Beaglebone and an Arduino epoxied to an aluminum plate.

My goal was to be able to use the Due as a wireless serial port, for a Beaglebone that I wanted to use for a CNC controller project.  It took three days of poring through the source code in /Applications/Arduino.app, the SAM3X8E technical reference manual, the USB 2.0 specification, and the Bluetooth 4.0 Core Specification to learn several things:

  • The Arduino USBHost library is definitely work in progress – the USB Host Shield 2.0 library created by Kristian Lauszus of TKJ Electronics was written to work with another family of microcontrollers used in Arduinos (the Atmega AVRs).  It doesn’t yet enable full use of the Arduino Due’s ‘native’ USB On-The-Go interface as a host interface;
  • There is enough Atmel-supplied support library code, bundled with the Arduino IDE, to extend Lauszus’  SPP (serial port profile) and BTD (Bluetooth Device) classes, if you were willing to hack at the code;
  • The USB Host Shield library Arduino code, when compiled for the Arduino Due, only speaks to endpoint zero, the USB control endpoint.  Trying to read from the ill-named Interrupt endpoint (it’s actually polled) results in a timeout because initialization calls to set up data structures for endpoint zero were not applied to other endpoints on the Bluetooth device.

So what I ended up doing was extracting just three classes from Lauszus’ code – the SPP, BTD, and USBHost classes – and thrashing at the sample code to eventually yield this:

arduino-due-pairing

 

The Bluetooth dongle is attached to an Arduino Due using a USB OTG Host Cable, which in turn is powered by an external 12V power supply.

The code here (USBHost-Due-BT.tar.bz2, .tar.bz2) replaces the USB Host library.  You can use a sketch similar to the one below to experiment with the library code (you’ll modify the .cpp and .h files containing classes SPP, BTD, and USBHost to hack the code into shape).

 

#include 
#include 

void serialEventRun(void) {
  if (Serial.available()) 
          serialEvent();
  if (Serial1.available()) 
          serialEvent1();
}

void serialEvent1() {
  // Serial1 -> Host
  while (Serial1.available()) {
    Serial.write(Serial1.read());
  }
}

void serialEvent() {
  // Host -> Serial1
  while (Serial.available()) {
    Serial1.write(Serial.read());
  }
}

USBHost usb;
BTD dongle(&usb,"Arduino Due","123456");
SPP spp(&dongle);
boolean firstMessage;

#define LED 13
#define RXLED 72
#define TXLED 73

void setup() {

  pinMode(LED,OUTPUT);
  pinMode(RXLED,OUTPUT);
  pinMode(TXLED,OUTPUT);

  digitalWrite(LED,LOW);
  Serial.begin(115200);
  Serial1.begin(115200);

  firstMessage = true;

  Serial.println("Arduino Due - Bluetooth SPP\r\n");

  spp.Initialize(&dongle);
}

void loop() {

  usb.Task();
  digitalWrite(TXLED,usb.getNakFlag() ? HIGH : LOW);
  /*
  if(SerialBT.available()) {
    if(firstMessage) {
      firstMessage = false;
      SerialBT.println(F("Hello from Arduino")); // Send welcome message
    }
    if(Serial.available())
      SerialBT.write(Serial.read());
    if(SerialBT.available())
      Serial.write(SerialBT.read());
  }
  else
    firstMessage = true;
  */  
}

Not Rescinded Yet: Cybercrime Prevention Act 2012

Retrieved 13 June 2013, at 9:16pm
from The Official Gazette

S. No. 2796
H. No. 5808

Republic of the Philippines
Congress of the Philippines
Metro Manila
Fifteenth Congress

Second Regular Session

Begun and held in Metro Manila, on Monday the Twenty-fifth day of July two thousand eleven.

[ Republic Act No. 10175 ]

AN ACT DEFINING CYBERCRIME, PROVIDING FOR THE PREVENTION, INVESTIGATION, SUPPRESSION AND THE IMPOSITION OF PENALTIES THEREFOR AND FOR OTHER PURPOSES

Be it enacted by the Senate and House of Representatives of the Philippines in Congress assembled:

CHAPTER I
PRELIMINARY PROVISIONS

SECTION 1. Title. — This Act shall be known as the “Cybercrime Prevention Act of 2012″.

SEC. 2. Declaration of Policy. — The State recognizes the vital role of information and communications industries such as content production, telecommunications, broadcasting electronic commerce, and data processing, in the nation’s overall social and economic development. The State also recognizes the importance of providing an environment conducive to the development, acceleration, and rational application and exploitation of information and communications technology (ICT) to attain free, easy, and intelligible access to exchange and/or delivery of information; and the need to protect and safeguard the integrity of computer, computer and communications systems, networks, and databases, and the confidentiality, integrity, and availability of information and data stored therein, from all forms of misuse, abuse, and illegal access by making punishable under the law such conduct or conducts. In this light, the State shall adopt sufficient powers to effectively prevent and combat such offenses by facilitating their detection, investigation, and prosecution at both the domestic and international levels, and by providing arrangements for fast and reliable international cooperation.

SEC. 3. Definition of Terms. — For purposes of this Act, the following terms are hereby defined as follows:

(a) Access refers to the instruction, communication with, storing data in, retrieving data from, or otherwise making use of any resources of a computer system or communication network.

(b) Alteration refers to the modification or change, in form or substance, of an existing computer data or program.

(c) Communication refers to the transmission of information through ICT media, including voice, video and other forms of data.

(d) Computer refers to an electronic, magnetic, optical, electrochemical, or other data processing or communications device, or grouping of such devices, capable of performing logical, arithmetic, routing, or storage functions and which includes any storage facility or equipment or communications facility or equipment directly related to or operating in conjunction with such device. It covers any type of computer device including devices with data processing capabilities like mobile phones, smart phones, computer networks and other devices connected to the internet.

(e) Computer data refers to any representation of facts, information, or concepts in a form suitable for processing in a computer system including a program suitable to cause a computer system to perform a function and includes electronic documents and/or electronic data messages whether stored in local computer systems or online.

(f) Computer program refers to a set of instructions executed by the computer to achieve intended results.

(g) Computer system refers to any device or group of interconnected or related devices, one or more of which, pursuant to a program, performs automated processing of data. It covers any type of device with data processing capabilities including, but not limited to, computers and mobile phones. The device consisting of hardware and software may include input, output and storage components which may stand alone or be connected in a network or other similar devices. It also includes computer data storage devices or media.

(h) Without right refers to either: (i) conduct undertaken without or in excess of authority; or (ii) conduct not covered by established legal defenses, excuses, court orders, justifications, or relevant principles under the law.

(i) Cyber refers to a computer or a computer network, the electronic medium in which online communication takes place.

(j) Critical infrastructure refers to the computer systems, and/or networks, whether physical or virtual, and/or the computer programs, computer data and/or traffic data so vital to this country that the incapacity or destruction of or interference with such system and assets would have a debilitating impact on security, national or economic security, national public health and safety, or any combination of those matters.

(k) Cybersecurity refers to the collection of tools, policies, risk management approaches, actions, training, best practices, assurance and technologies that can be used to protect the cyber environment and organization and user’s assets.

(l) Database refers to a representation of information, knowledge, facts, concepts, or instructions which are being prepared, processed or stored or have been prepared, processed or stored in a formalized manner and which are intended for use in a computer system.

(m) Interception refers to listening to, recording, monitoring or surveillance of the content of communications, including procuring of the content of data, either directly, through access and use of a computer system or indirectly, through the use of electronic eavesdropping or tapping devices, at the same time that the communication is occurring.

(n) Service provider refers to:

(1) Any public or private entity that provides to users of its service the ability to communicate by means of a computer system; and

(2) Any other entity that processes or stores computer data on behalf of such communication service or users of such service.

(o) Subscriber’s information refers to any information contained in the form of computer data or any other form that is held by a service provider, relating to subscribers of its services other than traffic or content data and by which identity can be established:

(1) The type of communication service used, the technical provisions taken thereto and the period of service;

(2) The subscriber’s identity, postal or geographic address, telephone and other access numbers, any assigned network address, billing and payment information, available on the basis of the service agreement or arrangement; and

(3) Any other available information on the site of the installation of communication equipment, available on the basis of the service agreement or arrangement.

(p) Traffic data or non-content data refers to any computer data other than the content of the communication including, but not limited to, the communication’s origin, destination, route, time, date, size, duration, or type of underlying service.

CHAPTER II
PUNISHABLE ACTS

SEC. 4. Cybercrime Offenses. — The following acts constitute the offense of cybercrime punishable under this Act:

(a) Offenses against the confidentiality, integrity and availability of computer data and systems:

(1) Illegal Access. – The access to the whole or any part of a computer system without right.

(2) Illegal Interception. – The interception made by technical means without right of any non-public transmission of computer data to, from, or within a computer system including electromagnetic emissions from a computer system carrying such computer data.

(3) Data Interference. — The intentional or reckless alteration, damaging, deletion or deterioration of computer data, electronic document, or electronic data message, without right, including the introduction or transmission of viruses.

(4) System Interference. — The intentional alteration or reckless hindering or interference with the functioning of a computer or computer network by inputting, transmitting, damaging, deleting, deteriorating, altering or suppressing computer data or program, electronic document, or electronic data message, without right or authority, including the introduction or transmission of viruses.

(5) Misuse of Devices.

(i) The use, production, sale, procurement, importation, distribution, or otherwise making available, without right, of:

(aa) A device, including a computer program, designed or adapted primarily for the purpose of committing any of the offenses under this Act; or

(bb) A computer password, access code, or similar data by which the whole or any part of a computer system is capable of being accessed with intent that it be used for the purpose of committing any of the offenses under this Act.

(ii) The possession of an item referred to in paragraphs 5(i)(aa) or (bb) above with intent to use said devices for the purpose of committing any of the offenses under this section.

(6) Cyber-squatting. – The acquisition of a domain name over the internet in bad faith to profit, mislead, destroy reputation, and deprive others from registering the same, if such a domain name is:

(i) Similar, identical, or confusingly similar to an existing trademark registered with the appropriate government agency at the time of the domain name registration:

(ii) Identical or in any way similar with the name of a person other than the registrant, in case of a personal name; and

(iii) Acquired without right or with intellectual property interests in it.

(b) Computer-related Offenses:

(1) Computer-related Forgery. —

(i) The input, alteration, or deletion of any computer data without right resulting in inauthentic data with the intent that it be considered or acted upon for legal purposes as if it were authentic, regardless whether or not the data is directly readable and intelligible; or

(ii) The act of knowingly using computer data which is the product of computer-related forgery as defined herein, for the purpose of perpetuating a fraudulent or dishonest design.

(2) Computer-related Fraud. — The unauthorized input, alteration, or deletion of computer data or program or interference in the functioning of a computer system, causing damage thereby with fraudulent intent: Provided, That if no

damage has yet been caused, the penalty imposable shall be one (1) degree lower.

(3) Computer-related Identity Theft. – The intentional acquisition, use, misuse, transfer, possession, alteration or deletion of identifying information belonging to another, whether natural or juridical, without right: Provided, That if no damage has yet been caused, the penalty imposable shall be one (1) degree lower.

(c) Content-related Offenses:

(1) Cybersex. — The willful engagement, maintenance, control, or operation, directly or indirectly, of any lascivious exhibition of sexual organs or sexual activity, with the aid of a computer system, for favor or consideration.

(2) Child Pornography. — The unlawful or prohibited acts defined and punishable by Republic Act No. 9775 or the Anti-Child Pornography Act of 2009, committed through a computer system: Provided, That the penalty to be imposed shall be (1) one degree higher than that provided for in Republic Act No. 9775.

(3) Unsolicited Commercial Communications. — The transmission of commercial electronic communication with the use of computer system which seek to advertise, sell, or offer for sale products and services are prohibited unless:

(i) There is prior affirmative consent from the recipient; or

(ii) The primary intent of the communication is for service and/or administrative announcements from the sender to its existing users, subscribers or customers; or

(iii) The following conditions are present:

(aa) The commercial electronic communication contains a simple, valid, and reliable way for the recipient to reject. receipt of further commercial electronic messages (opt-out) from the same source;

(bb) The commercial electronic communication does not purposely disguise the source of the electronic message; and

(cc) The commercial electronic communication does not purposely include misleading information in any part of the message in order to induce the recipients to read the message.

(4) Libel. — The unlawful or prohibited acts of libel as defined in Article 355 of the Revised Penal Code, as amended, committed through a computer system or any other similar means which may be devised in the future.

SEC. 5. Other Offenses. — The following acts shall also constitute an offense:

(a) Aiding or Abetting in the Commission of Cybercrime. – Any person who willfully abets or aids in the commission of any of the offenses enumerated in this Act shall be held liable.

(b) Attempt in the Commission of Cybercrime. — Any person who willfully attempts to commit any of the offenses enumerated in this Act shall be held liable.

SEC. 6. All crimes defined and penalized by the Revised Penal Code, as amended, and special laws, if committed by, through and with the use of information and communications technologies shall be covered by the relevant provisions of this Act: Provided, That the penalty to be imposed shall be one (1) degree higher than that provided for by the Revised Penal Code, as amended, and special laws, as the case may be.

SEC. 7. Liability under Other Laws. — A prosecution under this Act shall be without prejudice to any liability for violation of any provision of the Revised Penal Code, as amended, or special laws.

CHAPTER III
PENALTIES

SEC. 8. Penalties. — Any person found guilty of any of the punishable acts enumerated in Sections 4(a) and 4(b) of this Act shall be punished with imprisonment of prision mayor or a fine of at least Two hundred thousand pesos (PhP200,000.00) up to a maximum amount commensurate to the damage incurred or both.

Any person found guilty of the punishable act under Section 4(a)(5) shall be punished with imprisonment of prision mayor or a fine of not more than Five hundred thousand pesos (PhP500,000.00) or both.

If punishable acts in Section 4(a) are committed against critical infrastructure, the penalty of reclusion temporal or a fine of at least Five hundred thousand pesos (PhP500,000.00) up to maximum amount commensurate to the damage incurred or both, shall be imposed.

Any person found guilty of any of the punishable acts enumerated in Section 4(c)(1) of this Act shall be punished with imprisonment of prision mayor or a fine of at least Two hundred thousand pesos (PhP200,000.00) but not exceeding One million pesos (PhP1,000,000.00) or both.

Any person found guilty of any of the punishable acts enumerated in Section 4(c)(2) of this Act shall be punished with the penalties as enumerated in Republic Act No. 9775 or the “Anti-Child Pornography Act of 2009″: Provided, That the penalty to be imposed shall be one (1) degree higher than that provided for in Republic Act No. 9775, if committed through a computer system.

Any person found guilty of any of the punishable acts enumerated in Section 4(c)(3) shall be punished with imprisonment of arresto mayor or a fine of at least Fifty thousand pesos (PhP50,000.00) but not exceeding Two hundred fifty thousand pesos (PhP250,000.00) or both.

Any person found guilty of any of the punishable acts enumerated in Section 5 shall be punished with imprisonment one (1) degree lower than that of the prescribed penalty for the offense or a fine of at least One hundred thousand pesos (PhP100,000.00) but not exceeding Five hundred thousand pesos (PhP500,000.00) or both.

SEC. 9. Corporate Liability. — When any of the punishable acts herein defined are knowingly committed on behalf of or for the benefit of a juridical person, by a natural person acting either individually or as part of an organ of the juridical person, who has a leading position within, based on: (a) a power of representation of the juridical person provided the act committed falls within the scope of such authority; (b) an authority to take decisions on behalf of the juridical person: Provided, That the act committed falls within the scope of such authority; or (c) an authority to exercise control within the juridical person, the juridical person shall be held liable for a fine equivalent to at least double the fines imposable in Section 7 up to a maximum of Ten million pesos (PhP10,000,000.00).

If the commission of any of the punishable acts herein defined was made possible due to the lack of supervision or control by a natural person referred to and described in the preceding paragraph, for the benefit of that juridical person by a natural person acting under its authority, the juridical person shall be held liable for a fine equivalent to at least double the fines imposable in Section 7 up to a maximum of Five million pesos (PhP5,000,000.00).

The liability imposed on the juridical person shall be without prejudice to the criminal liability of the natural person who has committed the offense.

CHAPTER IV
ENFORCEMENT AND IMPLEMENTATION

SEC. 10. Law Enforcement Authorities. — The National Bureau of Investigation (NBI) and the Philippine National Police (PNP) shall be responsible for the efficient and effective law enforcement of the provisions of this Act. The NBI and the PNP shall organize a cybercrime unit or center manned by special investigators to exclusively handle cases involving violations of this Act.

SEC. 11. Duties of Law Enforcement Authorities. — To ensure that the technical nature of cybercrime and its prevention is given focus and considering the procedures involved for international cooperation, law enforcement authorities specifically the computer or technology crime divisions or units responsible for the investigation of cybercrimes are required to submit timely and regular reports including pre-operation, post-operation and investigation results and such other documents as may be required to the Department of Justice (DOJ) for review and monitoring.

SEC. 12. Real-Time Collection of Traffic Data. — Law enforcement authorities, with due cause, shall be authorized to collect or record by technical or electronic means traffic data in real-time associated with specified communications transmitted by means of a computer system.

Traffic data refer only to the communication’s origin, destination, route, time, date, size, duration, or type of underlying service, but not content, nor identities.

All other data to be collected or seized or disclosed will require a court warrant.

Service providers are required to cooperate and assist law enforcement authorities in the collection or recording of the above-stated information.

The court warrant required under this section shall only be issued or granted upon written application and the examination under oath or affirmation of the applicant and the witnesses he may produce and the showing: (1) that there are reasonable grounds to believe that any of the crimes enumerated hereinabove has been committed, or is being committed, or is about to be committed: (2) that there are reasonable grounds to believe that evidence that will be obtained is essential to the conviction of any person for, or to the solution of, or to the prevention of, any such crimes; and (3) that there are no other means readily available for obtaining such evidence.

SEC. 13. Preservation of Computer Data. — The integrity of traffic data and subscriber information relating to communication services provided by a service provider shall be preserved for a minimum period of six (6) months from the date of the transaction. Content data shall be similarly preserved for six (6) months from the date of receipt of the order from law enforcement authorities requiring its preservation.

Law enforcement authorities may order a one-time extension for another six (6) months: Provided, That once computer data preserved, transmitted or stored by a service provider is used as evidence in a case, the mere furnishing to such service provider of the transmittal document to the Office of the Prosecutor shall be deemed a notification to preserve the computer data until the termination of the case.

The service provider ordered to preserve computer data shall keep confidential the order and its compliance.

SEC. 14. Disclosure of Computer Data. — Law enforcement authorities, upon securing a court warrant, shall issue an order requiring any person or service provider to disclose or submit subscriber’s information, traffic data or relevant data in his/its possession or control within seventy-two (72) hours from receipt of the order in relation to a valid complaint officially docketed and assigned for investigation and the disclosure is necessary and relevant for the purpose of investigation.

SEC. 15. Search, Seizure and Examination of Computer Data. — Where a search and seizure warrant is properly issued, the law enforcement authorities shall likewise have the following powers and duties.

Within the time period specified in the warrant, to conduct interception, as defined in this Act, and:

(a) To secure a computer system or a computer data storage medium;

(b) To make and retain a copy of those computer data secured;

(c) To maintain the integrity of the relevant stored computer data;

(d) To conduct forensic analysis or examination of the computer data storage medium; and

(e) To render inaccessible or remove those computer data in the accessed computer or computer and communications network.

Pursuant thereof, the law enforcement authorities may order any person who has knowledge about the functioning of the computer system and the measures to protect and preserve the computer data therein to provide, as is reasonable, the necessary information, to enable the undertaking of the search, seizure and examination.

Law enforcement authorities may request for an extension of time to complete the examination of the computer data storage medium and to make a return thereon but in no case for a period longer than thirty (30) days from date of approval by the court.

SEC. 16. Custody of Computer Data. — All computer data, including content and traffic data, examined under a proper warrant shall, within forty-eight (48) hours after the expiration of the period fixed therein, be deposited with the court in a sealed package, and shall be accompanied by an affidavit of the law enforcement authority executing it stating the dates and times covered by the examination, and the law enforcement authority who may access the deposit, among other relevant data. The law enforcement authority shall also certify that no duplicates or copies of the whole or any part thereof have been made, or if made, that all such duplicates or copies are included in the package deposited with the court. The package so deposited shall not be opened, or the recordings replayed, or used in evidence, or then contents revealed, except upon order of the court, which shall not be granted except upon motion, with due notice and opportunity to be heard to the person or persons whose conversation or communications have been recorded.

SEC. 17. Destruction of Computer Data. — Upon expiration of the periods as provided in Sections 13 and 15, service providers and law enforcement authorities, as the case may be, shall immediately and completely destroy the computer data subject of a preservation and examination.

SEC. 18. Exclusionary Rule. — Any evidence procured without a valid warrant or beyond the authority of the same shall be inadmissible for any proceeding before any court or tribunal.

SEC. 19. Restricting or Blocking Access to Computer Data. — When a computer data is prima facie found to be in violation of the provisions of this Act, the DOJ shall issue an order to restrict or block access to such computer data.

SEC. 20. Noncompliance. — Failure to comply with the provisions of Chapter IV hereof specifically the orders from law enforcement authorities shall be punished as a violation of Presidential Decree No. 1829 with imprisonment of prision correctional in its maximum period or a fine of One hundred thousand pesos (Php100,000.00) or both, for each and every noncompliance with an order issued by law enforcement authorities.

CHAPTER V
JURISDICTION

SEC. 21. Jurisdiction. — The Regional Trial Court shall have jurisdiction over any violation of the provisions of this Act. including any violation committed by a Filipino national regardless of the place of commission. Jurisdiction shall lie if any of the elements was committed within the Philippines or committed with the use of any computer system wholly or partly situated in the country, or when by such commission any damage is caused to a natural or juridical person who, at the time the offense was committed, was in the Philippines.

There shall be designated special cybercrime courts manned by specially trained judges to handle cybercrime cases.

CHAPTER VI
INTERNATIONAL COOPERATION

Sec. 22. General Principles Relating to International Cooperation — All relevant international instruments on international cooperation in criminal matters, arrangements agreed on the basis of uniform or reciprocal legislation, and domestic laws, to the widest extent possible for the purposes of investigations or proceedings concerning criminal offenses related to computer systems and data, or for the collection of evidence in electronic form of a criminal, offense shall be given full force and effect.

CHAPTER VII
COMPETENT AUTHORITIES

SEC 23. Department of Justice (DOJ). — There is hereby created an Office of Cybercrime within the DOJ designated as the central authority in all matters related to international mutual assistance and extradition.

SEC. 24. Cybercrime Investigation and Coordinating Center. — There is hereby created, within thirty (30) days from the effectivity of this Act, an inter-agency body to be known as the Cybercrime Investigation and Coordinating Center (CICC), under the administrative supervision of the Office of the President, for policy coordination among concerned agencies and for the formulation and enforcement of the national cybersecurity plan.

SEC. 25. Composition. — The CICC shall be headed by the Executive Director of the Information and Communications Technology Office under the Department of Science and Technology (ICTO-DOST) as Chairperson with the Director of the NBI as Vice Chairperson; the Chief of the PNP; Head of the DOJ Office of Cybercrime; and one (1) representative from the private sector and academe, as members. The CICC shall be manned by a secretariat of selected existing personnel and representatives from the different participating agencies.

SEC. 26. Powers and Functions. — The CICC shall have the following powers and functions:

(a) To formulate a national cybersecurity plan and extend immediate assistance for the suppression of real-time commission of cybercrime offenses through a computer emergency response team (CERT);

(b) To coordinate the preparation of appropriate and effective measures to prevent and suppress cybercrime activities as provided for in this Act;

(c) To monitor cybercrime cases being bandied by participating law enforcement and prosecution agencies;

(d) To facilitate international cooperation on intelligence, investigations, training and capacity building related to cybercrime prevention, suppression and prosecution;

(e) To coordinate the support and participation of the business sector, local government units and nongovernment organizations in cybercrime prevention programs and other

related projects;

(f) To recommend the enactment of appropriate laws, issuances, measures and policies;

(g) To call upon any government agency to render assistance in the accomplishment of the CICC’s mandated tasks and functions; and

(h) To perform all other matters related to cybercrime prevention and suppression, including capacity building and such other functions and duties as may be necessary for the proper implementation of this Act.

CHAPTER VIII
FINAL PROVISIONS

SEC. 27. Appropriations. — The amount of Fifty million pesos (PhP50,000,000.00) shall be appropriated annually for the implementation of this Act.

SEC. 28. Implementing Rules and Regulations. — The ICTO-DOST, the DOJ and the Department of the Interior and Local Government (DILG) shall jointly formulate the necessary rules and regulations within ninety (90) days from approval of this Act, for its effective implementation.

SEC. 29. Separability Clause — If any provision of this Act is held invalid, the other provisions not affected shall remain in full force and effect.

SEC. 30. Repealing Clause. — All laws, decrees or rules inconsistent with this Act are hereby repealed or modified accordingly. Section 33(a) of Republic Act No. 8792 or the “Electronic Commerce Act” is hereby modified accordingly.

SEC. 31. Effectivity. — This Act shall take effect fifteen (15) days after the completion of its publication in the Official Gazette or in at least two (2) newspapers of general circulation.

Approved,

(Sgd.) FELICIANO BELMONTE JR.
Speaker of the House
of Representatives

(Sgd.) JUAN PONCE ENRILE
President of the Senate

This Act which is a consolidation of Senate Bill No. 2796 and House Bill No. 5808 was finally passed by the Senate and the House of Representatives on June 5, 2012 and June 4, 2012, respectively.

(Sgd.) MARILYN B. BARUA-YAP
Secretary General
House of Representatives

(Sgd.) EMMA LIRIO-REYES
Secretary of the Senate

 

Approved: SEP 12 2012

(Sgd.) BENIGNO S. AQUINO III
President of the Philippines

Avoidable delays

I’d forgotten to post this bunch of bits, this rant I wrote on the 16th.   Better to have this up among the bitclouds than on my laptop’s suspiciously slow, possibly damaged hard drive.

I was browsing news about results of the senatorial race, when a paragraph in yesterday’s article by Tricia Aquino caught my attention:

“Many of the BEI (Board of Election Inspectors) of the clustered precincts, after having a hard time [transmitting], or else did not try hard enough to transmit the PCOS election returns from their precincts… took their flashcards and carried these to the municipal and city canvassing centers,” said PPCRV chairperson Henrietta de Villa after consulting with Commission on Elections Commissioner Christian Lim about the slow pace.”

“Are they even supposed to be doing that?” I thought, taking the flash memory cards (presumably containing election returns) out of the PCOS machines? The Smartmatic website specifically says their devices are “designed to transmit the electoral data in a secure and unidirectional manner, with no need of human intervention, and in accordance to the requirements of the electoral body.”

These communication networks either work or they don’t; there is no “try”.  Unless the PCOS devices are transmitting results using the cell phone network, and they don’t have a signal – or are unable to “register” to cell towers.

“So, why aren’t they able to transmit?”  It doesn’t make sense that local protests would delay transmission of results via the data cellular network, as Commissioner Brilliantes explained yesterday (unless those protests involved burning cell antenna towers).  I can’t imagine why I’m still seeing under 75% of all returns from the unofficial counts being reflected in news summaries, as PLDT’s Mon Isberto has said that their network remained fully operational, so that “as a result, transmission of election returns that have been coursed through our facilities have been handled with dispatch.”

 

Since I can’t trust the marketing pages on Smartmatic’s site (and because the COMELEC website gives no technical information about how the system is intended to work), I have to wonder: Is it safe to trust that the content of those PCOS memory cards, having been removed from the PCOS machines, can’t be altered?  We need to know whether the election returns data on those cards is encrypted, and whether that encryption can resist being reversed, or “broken” during the time that those returns aren’t processed in the normal course of events.  The longer it takes for those results to be reflected in the national tally, the higher the likelihood that an attempt to “brute-force” the encryption (which I can only assume exists) on those cards will succeed.  If the content can be decrypted, it can be modified.  And with stakes this large, the cost of this technical hack is small beans, in relative terms (think several dozen computers, or the cost of hiring of a crooked engineer).

 

And why should transmission using any of the GSM networks even be a problem at all?  Didn’t COMELEC avail of cell tower coverage maps from telcos during their logistics planning for these elections?  Did they not consider having an alternative data transmission channel – say, landline DSL modems – as a backup, for voting precincts that have unreliable cell service?  It’s not like the precincts move around, so that it’s hard to tell in advance that this might be a problem.  They can’t be unaware that cell phone jamming equipment can be bought from overseas, so that provision has to be made against the possibility that some idiot would try to disrupt the electronic canvass. The only memo I found on the COMELEC site dealing with technical issues doesn’t describe what to do in the event of transmission failures.

If all this sounds like a backhanded critical swipe at the COMELEC, it can’t be helped; not after hearing the head commissioner dismiss the usefulness of a source code review by saying the PCOS machines ‘reads codal language’, not the source code.  There are no ‘codal instructions’, only ‘machine instructions’; that hamfisted effort to explain (i.e. dumb down) the discussion, the imprecision, leaves me cold. And more than a little angry, in fact, for which I offer no apology.

The COMELEC could have avoided these problems with suitable technical preparation. Some of which they could have taken with advice from a much larger audience: us, the voting public.  With 50 million registered, adult voters, there was no need to dumb down and minimize public discussion of how the electronic voting process was intended to work.

There are thousands of network engineers from whom COMELEC could have elicited feedback on the design of the overall system, and who would have identified this possible source of delay – and a means to work around it (i.e. get the supplier to provide dialup modems).  Thousands of programmers who work with embedded systems, who could have told the rest of us citizens whether or not the system could be trusted with our vote – and whether the integrity of the ERs would be preserved despite removing the flash cards from the PCOS devices.  Goodness, it’s 2013 – they could have used their website to publish a forum, for people to discuss the technical implementation.  The inability of COMELEC to be transparent, and to elicit citizen feedback is, right now, sorely testing the integrity of the vote.

Break time reading: The God Delusion

Taking a break from writing code, and too easy access to the depressing online news is a good thing; and what better thing to do with this time, than to read a real book?

The God Delusion by Richard Dawkins

The most striking quote I’ve found while listening to an audiobook of “The God Delusion” (after hearing an interview with the Thomas More Society’s Atty. Jo Imbong, on the successful passage of the Reproductive Health Law), is this one attributed to Voltaire:

“Those who can make you believe absurdities can make you commit atrocities”

Indeed.  And for all you advocates of the “rights of the unborn”:  Do pay heed to the rights of the ALREADY born, the adult Filipinos who would benefit from the implementation of the law, and share this country and planet with you now.

Carlos Celdran “offends religious feelings”, faces jail time

What the hell IS this? Are lay church members – plaintiffs insane?

Giving “religious offense” is actually a basis, in Manila, the Philippines, in 2013, for incarceration. WTF?! Nasa’n si Padre Damaso, ha, at ma-deport nga?!

Full text of the decision is available from the article at the Filipino Freethinkers, or from a local copy obtained off  https://docs.google.com/file/d/0ByIQb2-6J40ISGVXOTdXXzFpRGM/edit

There is more than one way to order and express our loyalties – to our families, communities (Church, town, teams) and to country – but relying on outdated, anti-Constitutional law to protect your “feelings” (read: political position on a topic about which you have a beleaguered opinion) is not an acceptable way to show fealty to the teachings of “the” Church.

To you plaintiffs who’ve caused Mr Celdran to be given jail time:  You know what? The Church’s position resisting sex education, and making contraception available to women citizens as a choice, is deeply offensive to me, what do you make of that?

Are you taking offense with other persons’ opinion about a topic that your religion has something else to say?  Get over it, and move with the rest of us into the public sphere.  Make your statement a political statement, but leave the religious feeling of the rest of us out of the public discourse.  You might win legislation, or you may not; but make the discussion a rational one, based on what all our fellow citizens need.

Errata:  Article was originally posted with the title “David Celdran ‘offends religious feelings’, faces jail time”.  That was not a spell check problem – for some unfathomable reasons of it’s own, my brain made that substitution, and my fingers followed. Sigh.  Must avoid posting when pissed off.

My apologies to stray visitors.

Frigging routing loop

Well, now. Google isn’t reachable – which shouldn’t be such a big deal, except that most Web pages these days make our browsers fetch scripts and content from the Google domain.  Curiously, my bank is online; as is my hosting provider.  My favorite machine tool porn site, Glacern Machine Tools, is also up. But no BBC, no Al Jazeera. WTF?

It’s partly down to a frigging routing loop (below), plus some modulation scheme jiggering so I need to dial down to EDGE rates to post this.

effing-routing-loopNow how does a telco manage to get itself into a routing loop?  On purpose.  Pack sheet, oo.  Makatulog na nga muna…

Teka…

… Nah, it’s probably not a DOJ takedown.

The DOJ Cybercrime Primer – Misleading silences

The Department of Justice published a short, “easy to read and simple to understand” three-page primer on cybercrime on November 26, 2012  (DOJ releases Primer on Cybercrime).  Being short, it is also appallingly devoid of intelligent discussion about how the infamous Cybercrime Prevention Act of 2012 (RA 10175) is perceived as a full-on attack on one of the foundations of democratic freedom, that of freedom of expressionContinue reading “The DOJ Cybercrime Primer – Misleading silences”