Click here to close now.


Microsoft Cloud Authors: Andreas Grabner, Elizabeth White, Jim Kaskade, Pat Romanski, David Bermingham

Related Topics: Microsoft Cloud

Microsoft Cloud: 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

    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
    Clearly the way forward is to move to cloud be it bare metal, VMs or containers. One aspect of the current public clouds that is slowing this cloud migration is cloud lock-in. Every cloud vendor is trying to make it very difficult to move out once a customer has chosen their cloud. In his session at 17th Cloud Expo, Naveen Nimmu, CEO of Clouber, Inc., will advocate that making the inter-cloud migration as simple as changing airlines would help the entire industry to quickly adopt the cloud without worrying about any lock-in fears. In fact by having standard APIs for IaaS would help PaaS expl...
    Apps and devices shouldn't stop working when there's limited or no network connectivity. Learn how to bring data stored in a cloud database to the edge of the network (and back again) whenever an Internet connection is available. In his session at 17th Cloud Expo, Bradley Holt, Developer Advocate at IBM Cloud Data Services, will demonstrate techniques for replicating cloud databases with devices in order to build offline-first mobile or Internet of Things (IoT) apps that can provide a better, faster user experience, both offline and online. The focus of this talk will be on IBM Cloudant, Apa...
    SYS-CON Events announced today that Cloud Raxak has been named “Media & Session Sponsor” of SYS-CON's 17th Cloud Expo, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Raxak Protect automates security compliance across private and public clouds. Using the SaaS tool or managed service, developers can deploy cloud apps quickly, cost-effectively, and without error.
    SYS-CON Events announced today that ProfitBricks, the provider of painless cloud infrastructure, will exhibit at SYS-CON's 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. ProfitBricks is the IaaS provider that offers a painless cloud experience for all IT users, with no learning curve. ProfitBricks boasts flexible cloud servers and networking, an integrated Data Center Designer tool for visual control over the cloud and the best price/performance value available. ProfitBricks was named one of the coolest Clo...
    Organizations already struggle with the simple collection of data resulting from the proliferation of IoT, lacking the right infrastructure to manage it. They can't only rely on the cloud to collect and utilize this data because many applications still require dedicated infrastructure for security, redundancy, performance, etc. In his session at 17th Cloud Expo, Emil Sayegh, CEO of Codero Hosting, will discuss how in order to resolve the inherent issues, companies need to combine dedicated and cloud solutions through hybrid hosting – a sustainable solution for the data required to manage I...
    Mobile messaging has been a popular communication channel for more than 20 years. Finnish engineer Matti Makkonen invented the idea for SMS (Short Message Service) in 1984, making his vision a reality on December 3, 1992 by sending the first message ("Happy Christmas") from a PC to a cell phone. Since then, the technology has evolved immensely, from both a technology standpoint, and in our everyday uses for it. Originally used for person-to-person (P2P) communication, i.e., Sally sends a text message to Betty – mobile messaging now offers tremendous value to businesses for customer and empl...
    SYS-CON Events announced today that IBM Cloud Data Services has been named “Bronze Sponsor” of SYS-CON's 17th Cloud Expo, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. IBM Cloud Data Services offers a portfolio of integrated, best-of-breed cloud data services for developers focused on mobile computing and analytics use cases.
    Learn how IoT, cloud, social networks and last but not least, humans, can be integrated into a seamless integration of cooperative organisms both cybernetic and biological. This has been enabled by recent advances in IoT device capabilities, messaging frameworks, presence and collaboration services, where devices can share information and make independent and human assisted decisions based upon social status from other entities. In his session at @ThingsExpo, Michael Heydt, founder of Seamless Thingies, will discuss and demonstrate how devices and humans can be integrated from a simple clust...
    Who are you? How do you introduce yourself? Do you use a name, or do you greet a friend by the last four digits of his social security number? Assuming you don’t, why are we content to associate our identity with 10 random digits assigned by our phone company? Identity is an issue that affects everyone, but as individuals we don’t spend a lot of time thinking about it. In his session at @ThingsExpo, Ben Klang, Founder & President of Mojo Lingo, will discuss the impact of technology on identity. Should we federate, or not? How should identity be secured? Who owns the identity? How is identity ...
    You have your devices and your data, but what about the rest of your Internet of Things story? Two popular classes of technologies that nicely handle the Big Data analytics for Internet of Things are Apache Hadoop and NoSQL. Hadoop is designed for parallelizing analytical work across many servers and is ideal for the massive data volumes you create with IoT devices. NoSQL databases such as Apache HBase are ideal for storing and retrieving IoT data as “time series data.”
    SYS-CON Events announced today that HPM Networks will exhibit at the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. For 20 years, HPM Networks has been integrating technology solutions that solve complex business challenges. HPM Networks has designed solutions for both SMB and enterprise customers throughout the San Francisco Bay Area.
    The broad selection of hardware, the rapid evolution of operating systems and the time-to-market for mobile apps has been so rapid that new challenges for developers and engineers arise every day. Security, testing, hosting, and other metrics have to be considered through the process. In his session at Big Data Expo, Walter Maguire, Chief Field Technologist, HP Big Data Group, at Hewlett-Packard, will discuss the challenges faced by developers and a composite Big Data applications builder, focusing on how to help solve the problems that developers are continuously battling.
    As enterprises capture more and more data of all types – structured, semi-structured, and unstructured – data discovery requirements for business intelligence (BI), Big Data, and predictive analytics initiatives grow more complex. A company’s ability to become data-driven and compete on analytics depends on the speed with which it can provision their analytics applications with all relevant information. The task of finding data has traditionally resided with IT, but now organizations increasingly turn towards data source discovery tools to find the right data, in context, for business users, d...
    SYS-CON Events announced today that MobiDev, a software development company, will exhibit at the 17th International Cloud Expo®, which will take place November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. MobiDev is a software development company with representative offices in Atlanta (US), Sheffield (UK) and Würzburg (Germany); and development centers in Ukraine. Since 2009 it has grown from a small group of passionate engineers and business managers to a full-scale mobile software company with over 150 developers, designers, quality assurance engineers, project manage...
    “The Internet of Things transforms the way organizations leverage machine data and gain insights from it,” noted Splunk’s CTO Snehal Antani, as Splunk announced accelerated momentum in Industrial Data and the IoT. The trend is driven by Splunk’s continued investment in its products and partner ecosystem as well as the creativity of customers and the flexibility to deploy Splunk IoT solutions as software, cloud services or in a hybrid environment. Customers are using Splunk® solutions to collect and correlate data from control systems, sensors, mobile devices and IT systems for a variety of Ind...
    SYS-CON Events announced today that Solgeniakhela will exhibit at SYS-CON's 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Solgeniakhela is the global market leader in Cloud Collaboration and Cloud Infrastructure software solutions. Designed to “Bridge the Gap” between Personal and Professional Social, Mobile and Cloud user experiences, our solutions help large and medium-sized organizations dramatically improve productivity, reduce collaboration costs, and increase the overall enterprise value by bringing ...
    Sensors and effectors of IoT are solving problems in new ways, but small businesses have been slow to join the quantified world. They’ll need information from IoT using applications as varied as the businesses themselves. In his session at @ThingsExpo, Roger Meike, Distinguished Engineer, Director of Technology Innovation at Intuit, will show how IoT manufacturers can use open standards, public APIs and custom apps to enable the Quantified Small Business. He will use a Raspberry Pi to connect sensors to web services, and cloud integration to connect accounting and data, providing a Bluetooth...
    SYS-CON Events announced today that Micron Technology, Inc., a global leader in advanced semiconductor systems, will exhibit at the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Micron’s broad portfolio of high-performance memory technologies – including DRAM, NAND and NOR Flash – is the basis for solid state drives, modules, multichip packages and other system solutions. Backed by more than 35 years of technology leadership, Micron's memory solutions enable the world's most innovative computing, consumer,...
    Nowadays, a large number of sensors and devices are connected to the network. Leading-edge IoT technologies integrate various types of sensor data to create a new value for several business decision scenarios. The transparent cloud is a model of a new IoT emergence service platform. Many service providers store and access various types of sensor data in order to create and find out new business values by integrating such data.
    SYS-CON Media announced that Splunk, a provider of the leading software platform for real-time Operational Intelligence, has launched an ad campaign on Big Data Journal. Splunk software and cloud services enable organizations to search, monitor, analyze and visualize machine-generated big data coming from websites, applications, servers, networks, sensors and mobile devices. The ads focus on delivering ROI - how improved uptime delivered $6M in annual ROI, improving customer operations by mining large volumes of unstructured data, and how data tracking delivers uptime when it matters most.