Welcome!

.NET Authors: Yeshim Deniz, Ivan Antsipau, Liz McMillan, Michael Bushong, Tad Anderson

Related Topics: .NET

.NET: Article

Securing .NET Compact Framework Solutions

Securing .NET Compact Framework Solutions

In recent times, and with good reason - as attacks by worms such as Code Red, Nimbda, and Slammer have shown - security has been pushed to the forefront of the minds of architects and developers. And just as Microsoft has rededicated itself to security through its Trustworthy Computing Initiative, your organization should be sure to design and implement its applications using secure coding practices and principles. Even though .NET Compact Framework applications may at first appear immune to such attacks, their connection to back-end systems and their portability introduce a variety of security risks that must be mitigated.

In this column we'll review what you'll need to consider to implement security at the device, application, and communication layers.

Secure the Device
The first layer of security to consider is that provided by the device itself. In addition to relying on mechanisms provided by the device manufacturer or platform (such as the Pocket PC running on Windows CE), your organization can augment the OS software with third-party solutions. Generally, the types of security that can be used to protect the device fall into the categories of authentication, antivirus protection, and lockdown.

  • Authentication: The simplest step organizations can take to protect devices on which Compact Framework applications run is to require some form of authentication. For example, Pocket PC 2002 and later devices running Windows CE support both simple and strong power-on password authentication. By enabling this feature on the device, the user must type in a simple four-character, or more complex seven-character, password at a configurable interval that defaults to one hour. If a user enters an incorrect password, an exponentially increasing time delay is enforced, making it very difficult to repeatedly guess the password. Third-party vendors, such as Trust Digital LLC through its PDASecure product, provide power-on password authentication with additional options that include locking the device after a certain number of invalid password attempts and additionally requiring a soft reset, hard reset, or even "wiping" the device of its data.

    Although this form of authentication can be quite effective, it is based on knowledge of a password that can perhaps be obtained through illegitimate means. To implement authentication based on possession of a physical item like a smart card or a cryptographic certificate located on a removable storage card, or based on user identity through biometric (e.g., fingerprint) or signature identification, third-party products are required. Vendors such as A2000 Distribution, Certicom Corporation, and Cloakware Corporation provide a variety of such solutions.

  • Antivirus Protection: Even though viruses that target mobile devices are not as prevalent as those targeting desktop computers, they are still a potential threat to any software on the device. Typically, however, devices are not damaged by viruses but rather pass them into a corporate network via e-mail attachments and documents. There are, as you might expect, a variety of antivirus packages on the market for devices such as the Pocket PC, from vendors including McAfee, Computer Associates, and F-Secure. Additionally, personal firewall products such as VPN-1 are available from vendors such as Check Point Software Technologies Ltd.

  • Lockdown: Following the accepted security principle of "reducing the attack surface," many organizations may wish to disable some features of the device. Third-party software such as PDASecure, for example, does just that by password protecting or disabling infrared communications, ActiveSync, and the voice recorder.

    Secure the Application
    The second layer to which security should be applied is the application itself. Typically, such security includes the concepts of authentication, data protection, and user input.

  • Authentication: Of course, the main way to secure an application on the device is by requiring the user to present credentials in order to be authenticated by the application. However, depending on what data source the application uses and how it creates a connection, this process can vary greatly. For example, a Compact Framework application might need to authenticate directly to SQL Server when using the SQLClient .NET Data Provider, to a Web server and SQL Server when using Remote Data Access or replication with SQL Server 2000 Windows CE Edition (SSCE), through a SOAP request when using an XML Web service, or through HTTP when using the HTTP pluggable protocol.

    In each of these cases your application must manage the credentials. In the case where multiple sets of credentials are required (for example, for a proxy and Web server in addition to SQL Server) it is a good practice to store the credentials in an encrypted database or file on the device or even on a storage card that is required to be inserted before the application can run.

  • Data protection: This concept involves two key aspects. First, any local data used by the application must be secured. This can be most easily accomplished using the built-in encryption feature of SSCE, which encrypts the database using the RC4 symmetric encryption algorithm with a key generated from an MD5 hash of the password (which implies that the strength of the encryption is dependent on the length of the password chosen). However, if local data is stored in a file it will need to be encrypted using the CryptoAPI (which supports 128-bit encryption on Pocket PC 2002 and Pocket PC 2000 with the Microsoft High Encryption Pack installed) since the System.Security. Cryptography namespace is not supported in the Compact Framework. Additionally, third-party encryption tools such as PDASecure support encryption of individual files.

  • User input: As codified in the "Don't Trust User Input" security principle, you need to secure user input. This issue is most directly relevant when accepting user input that is subsequently used to query or update data in SSCE or on a remote SQL Server. Malicious users may attempt to insert or inject additional SQL into a TextBox control, thereby causing a possibly harmful statement to run against the database. Such SQL injection attacks can be mitigated by cleansing user input with a function. In general, user input can be checked using regular expressions through the RegEx class of the System.Text.RegularExpressions namespace. One interesting use of this class is to create a derived TextBox control that uses a regular expression to validate the text entered by the user.

    Secure the Channel
    The final aspect to securing an application involves securing the transmission of data across the network. This aspect can involve a wide range of issues, including the use of Secure Sockets Layer (SSL), Virtual Private Networks (VPNs), and Wired Equivalent Privacy (WEP).

  • Secure Sockets Layer: The most fundamental way to secure the communication channel between a device and network is the use of SSL over HTTP. Simply put, SSL uses public- and private-key encryption based on the RSA algorithm, along with the use of a digital certificate to encrypt all of the communication between a client and a server. Fortunately, support for 128-bit SSL is built into both Pocket PC 2002 and 2000 devices (with the Microsoft High Encryption Pack installed). Since SSL is used over HTTP, Compact Framework applications can use it when connecting to a back-end server using SSCE connectivity, XML Web services, or the HTTP pluggable protocol.

    On the server side, the IIS server must have a digital certificate installed for the virtual directory in which the resource (the HTML page, for example) resides. The certificate may be either one obtained from a trusted certificate authority such as VeriSign or one generated internally within the organization using Microsoft Certificate Server. In the latter case the root certificate for your organization must also be installed on the device.

  • Virtual private networks: A second option for encrypting the communication channel is the use of VPNs that rely on protocols such as the Point-to-Point Tunneling Protocol (PPTP) and the IP security protocol (IPSec) to both authenticate and encrypt communications. While Pocket PC 2002 and Windows CE .NET 4.1 devices do not support IPSec, they do support PPTP when setting up connections in the Connections tab of the device Settings. After entering the address of the VPN server for the connection, the device will prompt the user for credentials when a connection is made. In order to provide VPN functionality to Pocket PC 2000 devices or to use IPSec, a number of third-party products are available from vendors, including Certicom Corporation and Check Point Software Technologies.

  • Wired Equivalent Privacy: In wireless networks, unlike in wired LANs, walls are ineffective as a means of security since radio waves are not bound by the walls used to protect the network. A first-generation technology used to protect such networks was based on the WEP security protocol. However, this protocol was found to contain flaws that left it vulnerable to attack. As a result, WEP is considered unsecure and should not be used without additional security such as VPNs or SSL.

    Although an initiative called WEP2 was developed to address the issues with WEP, many in the industry felt it too was vulnerable to attack. However, the 802.11i standard, currently in draft form, addresses many of these security issues. While the new specification is being ratified, wireless vendors have agreed on an interim solution called Wi-Fi Protected Access (WPA). WPA support is currently being rolled out in products such as Funk Software's Odyssey Client and Meetinghouse Data Communications' AEGIS Client. In the interim other organizations using server and client software primarily from Funk and Meetinghouse have gone forward and implemented the Extensible Authentication Protocol (EAP) over the competing Tunneled Transport Layer Security (TTLS) protocol developed by Funk and Certicom and the Protected Extensible Authentication Protocol (PEAP) developed by Microsoft and Cisco Systems to allow secure access to WLANs on their corporate campuses. In addition, third parties such as MobileSys, Inc., and Altarus Corporation offer wireless encryption technology.

    Security Is Key
    We hope this column has given you a framework for thinking about how to secure your .NET Compact Framework applications.

  • More Stories By Jon Box

    Jon Box is an Architect Evangelist in Developer & Platform Evangelism with the Microsoft Corporation. He coauthored Building Solutions with the Microsoft .NET Compact Framework, published by Addison-Wesley, and blogs at http://blogs.msdn.com/jonbox/default.aspx.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    Software AG helps organizations transform into Digital Enterprises, so they can differentiate from competitors and better engage customers, partners and employees. Using the Software AG Suite, companies can close the gap between business and IT to create digital systems of differentiation that drive front-line agility. We offer four on-ramps to the Digital Enterprise: alignment through collaborative process analysis; transformation through portfolio management; agility through process automation and integration; and visibility through intelligent business operations and big data.
    There will be 50 billion Internet connected devices by 2020. Today, every manufacturer has a propriety protocol and an app. How do we securely integrate these "things" into our lives and businesses in a way that we can easily control and manage? Even better, how do we integrate these "things" so that they control and manage each other so our lives become more convenient or our businesses become more profitable and/or safe? We have heard that the best interface is no interface. In his session at Internet of @ThingsExpo, Chris Matthieu, Co-Founder & CTO at Octoblu, Inc., will discuss how these devices generate enough data to learn our behaviors and simplify/improve our lives. What if we could connect everything to everything? I'm not only talking about connecting things to things but also systems, cloud services, and people. Add in a little machine learning and artificial intelligence and now we have something interesting...
    Last week, while in San Francisco, I used the Uber app and service four times. All four experiences were great, although one of the drivers stopped for 30 seconds and then left as I was walking up to the car. He must have realized I was a blogger. None the less, the next car was just a minute away and I suffered no pain. In this article, my colleague, Ved Sen, Global Head, Advisory Services Social, Mobile and Sensors at Cognizant shares his experiences and insights.
    We are reaching the end of the beginning with WebRTC and real systems using this technology have begun to appear. One challenge that faces every WebRTC deployment (in some form or another) is identity management. For example, if you have an existing service – possibly built on a variety of different PaaS/SaaS offerings – and you want to add real-time communications you are faced with a challenge relating to user management, authentication, authorization, and validation. Service providers will want to use their existing identities, but these will have credentials already that are (hopefully) irreversibly encoded. In his session at Internet of @ThingsExpo, Peter Dunkley, Technical Director at Acision, will look at how this identity problem can be solved and discuss ways to use existing web identities for real-time communication.
    Can call centers hang up the phones for good? Intuitive Solutions did. WebRTC enabled this contact center provider to eliminate antiquated telephony and desktop phone infrastructure with a pure web-based solution, allowing them to expand beyond brick-and-mortar confines to a home-based agent model. It also ensured scalability and better service for customers, including MUY! Companies, one of the country's largest franchise restaurant companies with 232 Pizza Hut locations. This is one example of WebRTC adoption today, but the potential is limitless when powered by IoT. Attendees will learn real-world benefits of WebRTC and explore future possibilities, as WebRTC and IoT intersect to improve customer service.
    From telemedicine to smart cars, digital homes and industrial monitoring, the explosive growth of IoT has created exciting new business opportunities for real time calls and messaging. In his session at Internet of @ThingsExpo, Ivelin Ivanov, CEO and Co-Founder of Telestax, will share some of the new revenue sources that IoT created for Restcomm – the open source telephony platform from Telestax. Ivelin Ivanov is a technology entrepreneur who founded Mobicents, an Open Source VoIP Platform, to help create, deploy, and manage applications integrating voice, video and data. He is the co-founder of TeleStax, an Open Source Cloud Communications company that helps the shift from legacy IN/SS7 telco networks to IP-based cloud comms. An early investor in multiple start-ups, he still finds time to code for his companies and contribute to open source projects.
    The Internet of Things (IoT) promises to create new business models as significant as those that were inspired by the Internet and the smartphone 20 and 10 years ago. What business, social and practical implications will this phenomenon bring? That's the subject of "Monetizing the Internet of Things: Perspectives from the Front Lines," an e-book released today and available free of charge from Aria Systems, the leading innovator in recurring revenue management.
    The Internet of Things will put IT to its ultimate test by creating infinite new opportunities to digitize products and services, generate and analyze new data to improve customer satisfaction, and discover new ways to gain a competitive advantage across nearly every industry. In order to help corporate business units to capitalize on the rapidly evolving IoT opportunities, IT must stand up to a new set of challenges.
    There’s Big Data, then there’s really Big Data from the Internet of Things. IoT is evolving to include many data possibilities like new types of event, log and network data. The volumes are enormous, generating tens of billions of logs per day, which raise data challenges. Early IoT deployments are relying heavily on both the cloud and managed service providers to navigate these challenges. In her session at 6th Big Data Expo®, Hannah Smalltree, Director at Treasure Data, to discuss how IoT, Big Data and deployments are processing massive data volumes from wearables, utilities and other machines.
    All major researchers estimate there will be tens of billions devices – computers, smartphones, tablets, and sensors – connected to the Internet by 2020. This number will continue to grow at a rapid pace for the next several decades. With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo in Silicon Valley. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be!
    P2P RTC will impact the landscape of communications, shifting from traditional telephony style communications models to OTT (Over-The-Top) cloud assisted & PaaS (Platform as a Service) communication services. The P2P shift will impact many areas of our lives, from mobile communication, human interactive web services, RTC and telephony infrastructure, user federation, security and privacy implications, business costs, and scalability. In his session at Internet of @ThingsExpo, Erik Lagerway, Co-founder of Hookflash, will walk through the shifting landscape of traditional telephone and voice services to the modern P2P RTC era of OTT cloud assisted services.
    While great strides have been made relative to the video aspects of remote collaboration, audio technology has basically stagnated. Typically all audio is mixed to a single monaural stream and emanates from a single point, such as a speakerphone or a speaker associated with a video monitor. This leads to confusion and lack of understanding among participants especially regarding who is actually speaking. Spatial teleconferencing introduces the concept of acoustic spatial separation between conference participants in three dimensional space. This has been shown to significantly improve comprehension and conference efficiency.
    The Internet of Things is tied together with a thin strand that is known as time. Coincidentally, at the core of nearly all data analytics is a timestamp. When working with time series data there are a few core principles that everyone should consider, especially across datasets where time is the common boundary. In his session at Internet of @ThingsExpo, Jim Scott, Director of Enterprise Strategy & Architecture at MapR Technologies, will discuss single-value, geo-spatial, and log time series data. By focusing on enterprise applications and the data center, he will use OpenTSDB as an example to explain some of these concepts including when to use different storage models.
    SYS-CON Events announced today that Gridstore™, the leader in software-defined storage (SDS) purpose-built for Windows Servers and Hyper-V, will exhibit at SYS-CON's 15th International Cloud Expo®, which will take place on November 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. Gridstore™ is the leader in software-defined storage purpose built for virtualization that is designed to accelerate applications in virtualized environments. Using its patented Server-Side Virtual Controller™ Technology (SVCT) to eliminate the I/O blender effect and accelerate applications Gridstore delivers vmOptimized™ Storage that self-optimizes to each application or VM across both virtual and physical environments. Leveraging a grid architecture, Gridstore delivers the first end-to-end storage QoS to ensure the most important App or VM performance is never compromised. The storage grid, that uses Gridstore’s performance optimized nodes or capacity optimized nodes, starts with as few a...
    The Transparent Cloud-computing Consortium (abbreviation: T-Cloud Consortium) will conduct research activities into changes in the computing model as a result of collaboration between "device" and "cloud" and the creation of new value and markets through organic data processing High speed and high quality networks, and dramatic improvements in computer processing capabilities, have greatly changed the nature of applications and made the storing and processing of data on the network commonplace. These technological reforms have not only changed computers and smartphones, but are also changing the data processing model for all information devices. In particular, in the area known as M2M (Machine-To-Machine), there are great expectations that information with a new type of value can be produced using a variety of devices and sensors saving/sharing data via the network and through large-scale cloud-type data processing. This consortium believes that attaching a huge number of devic...
    Innodisk is a service-driven provider of industrial embedded flash and DRAM storage products and technologies, with a focus on the enterprise, industrial, aerospace, and defense industries. Innodisk is dedicated to serving their customers and business partners. Quality is vitally important when it comes to industrial embedded flash and DRAM storage products. That’s why Innodisk manufactures all of their products in their own purpose-built memory production facility. In fact, they designed and built their production center to maximize manufacturing efficiency and guarantee the highest quality of our products.
    Can call centers hang up the phones for good? Intuitive Solutions did. WebRTC enabled this contact center provider to eliminate antiquated telephony and desktop phone infrastructure with a pure web-based solution, allowing them to expand beyond brick-and-mortar confines to a home-based agent model. Download Slide Deck: ▸ Here
    All major researchers estimate there will be tens of billions devices - computers, smartphones, tablets, and sensors - connected to the Internet by 2020. This number will continue to grow at a rapid pace for the next several decades. Over the summer Gartner released its much anticipated annual Hype Cycle report and the big news is that Internet of Things has now replaced Big Data as the most hyped technology. Indeed, we're hearing more and more about this fascinating new technological paradigm. Every other IT news item seems to be about IoT and its implications on the future of digital business.
    BSQUARE is a global leader of embedded software solutions. We enable smart connected systems at the device level and beyond that millions use every day and provide actionable data solutions for the growing Internet of Things (IoT) market. We empower our world-class customers with our products, services and solutions to achieve innovation and success. For more information, visit www.bsquare.com.
    With the iCloud scandal seemingly in its past, Apple announced new iPhones, updates to iPad and MacBook as well as news on OSX Yosemite. Although consumers will have to wait to get their hands on some of that new stuff, what they can get is the latest release of iOS 8 that Apple made available for most in-market iPhones and iPads. Originally announced at WWDC (Apple’s annual developers conference) in June, iOS 8 seems to spearhead Apple’s newfound focus upon greater integration of their products into everyday tasks, cross-platform mobility and self-monitoring. Before you update your device, here is a look at some of the new features and things you may want to consider from a mobile security perspective.