Docsity

A Cryptographic Decentralized Label Model, Schemes and Mind Maps of Cryptography and System Security

Toggle sidebar
bg1
A Cryptographic Decentralized Label Model
Jeffrey A. Vaughan Steve Zdancewic∗
University of Pennsylvania
Abstract
Information-flow security policies are an appealing way
of specifying confidentiality and integrity policies in infor-
mation systems. Most previous work on language-based se-
curity has assumed that programs run in a closed, managed
environment and that they use potentially unsafe constructs,
such as declassification, to interface to external communi-
cation channels, perhaps after encrypting data to preserve
its confidentiality. This situation is unsatisfactory for sys-
tems that need to communicate over untrusted channels or
use untrusted persistent storage, since the connection be-
tween the cryptographic mechanisms used in the untrusted
environment and the abstract security labels used in the
trusted language environment is ad hoc and unclear.
This paper addresses this problem in three ways: First,
it presents a simple, security-typed language with a novel
mechanism called packages that provides an abstract means
for creating opaque objects and associating them with se-
curity labels; well-typed programs in this language enforce
noninterference. Second, it shows how to implement these
packages using public-key cryptography. This implementa-
tion strategy uses a variant of Myers and Liskov’s decen-
tralized label model, which supports a rich label structure
in which mutually distrusting data owners can specify inde-
pendent confidentiality and integrity requirements. Third, it
demonstrates that this implementation of packages is sound
with respect to Dolev-Yao style attackers—such an attacker
cannot determine the contents of a package without pos-
sessing the appropriate keys, as determined by the security
label on the package.
1 Introduction
Information-flow security policies are an appealing way
of specifying confidentiality and integrity policies in in-
∗This research was sponsored in part by NSF Grants CNS-0346939,
CNS-0524059 and CCF-0524035. Any opinions, findings and conclusions
or recommendations expressed in this material are those of the authors and
do not necessarily reflect the views of the NSF.
formation systems. Unlike traditional reference monitors
and cryptography, which regulate access to data, mecha-
nisms that enforce information-flow policies regulate how
the data (and information derived from the data) is al-
lowed to propagate throughout the system. Such end-to-
end security properties are important for applications that
require high degrees of confidentiality (such as those found
in SELinux [28]) and integrity (such as those found in criti-
cal embedded systems [9]).
Language-based mechanisms, which rely on static pro-
gram analysis, are one approach to determining whether a
given piece of software obeys an information-flow policy.
The key idea, stemming from the work by Denning [13, 14]
in the 1970’s, is to annotate program values with labels
drawn from a lattice of security levels and then have the
compiler verify that the program follows the standard “no
read up/no write down” noninterference policy [18, 8]. Fol-
lowing the work of Volpano, Smith, and Irvine [33], these
program analyses are usually expressed as a form of type-
checking.
The literature in this area has explored a wide variety of
label models, programming language features, mechanisms
for dealing with declassification and other kinds of down-
grading, and appropriate definitions of security (see the sur-
vey by Sabelfeld and Myers [27]). FlowCaml [25, 29] and
Jif [11] are two full-fledged programming languages that
support information-flow security policies. Jif, for exam-
ple, has been used to implement some simple distributed
games [5, 35] and a secure e-mail system [20].
Despite these promising results, one important open
question in the design of languages for information-flow
security is how to integrate them with other mechanisms
such as cryptography and traditional access controls. Un-
derstanding the relationship between cryptography and
information-flow is particularly important in the case of
“open” systems in which the data to be protected must leave
the managed environment provided by the language run-
time. For example, if the system needs to send protected
data over an untrusted network or write it to persistent stor-
age, encryption and digital signatures are the appropriate
means of providing confidentiality and integrity.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download A Cryptographic Decentralized Label Model and more Schemes and Mind Maps Cryptography and System Security in PDF only on Docsity!

A Cryptographic Decentralized Label Model

Jeffrey A. Vaughan Steve Zdancewic∗

University of Pennsylvania

Abstract

Information-flow security policies are an appealing way of specifying confidentiality and integrity policies in infor- mation systems. Most previous work on language-based se- curity has assumed that programs run in a closed, managed environment and that they use potentially unsafe constructs, such as declassification, to interface to external communi- cation channels, perhaps after encrypting data to preserve its confidentiality. This situation is unsatisfactory for sys- tems that need to communicate over untrusted channels or use untrusted persistent storage, since the connection be- tween the cryptographic mechanisms used in the untrusted environment and the abstract security labels used in the trusted language environment is ad hoc and unclear. This paper addresses this problem in three ways: First, it presents a simple, security-typed language with a novel mechanism called packages that provides an abstract means for creating opaque objects and associating them with se- curity labels; well-typed programs in this language enforce noninterference. Second, it shows how to implement these packages using public-key cryptography. This implementa- tion strategy uses a variant of Myers and Liskov’s decen- tralized label model, which supports a rich label structure in which mutually distrusting data owners can specify inde- pendent confidentiality and integrity requirements. Third, it demonstrates that this implementation of packages is sound with respect to Dolev-Yao style attackers—such an attacker cannot determine the contents of a package without pos- sessing the appropriate keys, as determined by the security label on the package.

1 Introduction

Information-flow security policies are an appealing way of specifying confidentiality and integrity policies in in-

∗This research was sponsored in part by NSF Grants CNS-0346939, CNS-0524059 and CCF-0524035. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the NSF.

formation systems. Unlike traditional reference monitors and cryptography, which regulate access to data, mecha- nisms that enforce information-flow policies regulate how the data (and information derived from the data) is al- lowed to propagate throughout the system. Such end-to- end security properties are important for applications that require high degrees of confidentiality (such as those found in SELinux [28]) and integrity (such as those found in criti- cal embedded systems [9]). Language-based mechanisms, which rely on static pro- gram analysis, are one approach to determining whether a given piece of software obeys an information-flow policy. The key idea, stemming from the work by Denning [13, 14] in the 1970’s, is to annotate program values with labels drawn from a lattice of security levels and then have the compiler verify that the program follows the standard “no read up/no write down” noninterference policy [18, 8]. Fol- lowing the work of Volpano, Smith, and Irvine [33], these program analyses are usually expressed as a form of type- checking. The literature in this area has explored a wide variety of label models, programming language features, mechanisms for dealing with declassification and other kinds of down- grading, and appropriate definitions of security (see the sur- vey by Sabelfeld and Myers [27]). FlowCaml [25, 29] and Jif [11] are two full-fledged programming languages that support information-flow security policies. Jif, for exam- ple, has been used to implement some simple distributed games [5, 35] and a secure e-mail system [20]. Despite these promising results, one important open question in the design of languages for information-flow security is how to integrate them with other mechanisms such as cryptography and traditional access controls. Un- derstanding the relationship between cryptography and information-flow is particularly important in the case of “open” systems in which the data to be protected must leave the managed environment provided by the language run- time. For example, if the system needs to send protected data over an untrusted network or write it to persistent stor- age, encryption and digital signatures are the appropriate means of providing confidentiality and integrity.

Although cryptography is an extremely valuable tool for security engineering, there has been surprisingly little work on developing a theory of how it and information- flow mechanisms can be brought together coherently. The work in this space includes the KDLM [12], crypto-masked flows [4], sealing calculi [31], cryptographic types [17], and computational security analyses of information-flow with encryption [21, 30]. In this paper, we explore a novel design for incorporating cryptographic operations with language- based information-flow security. We have three main goals for the programming language presented here. First, we want the programming model to have abstractions suitable for cryptographically enforc- ing information-flow policies specified via security labels. Second, the design of the new language primitives should free the programmer from the burden of having to manu- ally manage keys and their correspondence to information- flow policy labels. And, third, we should prove that, under a reasonable model of cryptography, programs written in the resulting language satisfy the standard noninterference properties expected in this context. In this paper, we realize the goals above by making the following contributions:

  • We develop a language, SImp, with primitives for en- forcing information-flow security policies, including a restricted form of cryptographic packaging. The novel language constructs are reminiscent of the pack/un- pack operations found in languages with existential or dynamic datatypes. Operationally, the use of these packaging constructs requires run-time checks that en- sure the security of program [17].
  • We show that packages have a natural implementa- tion in terms of public-key cryptography by defining a translation from language values to cryptographic messages; this translation depends on the structure of the labels used to define security policies. A variant of the decentralized label model [22] provides a pleasant setting for the translation.
  • We prove a noninterference result for SImp, includ- ing the downgrading implicit in its cryptographic pack- ages. We also demonstrate the soundness of the cryp- tographic interpretation of packages by showing that a Dolev-Yao attacker [16] cannot determine the contents of a package without possessing the appropriate keys (as determined by the translation of the security label on the package).

The rest of this paper is structured as follows. Section 2 introduces our information flow language and proves non- interference. Section 3 gives a Dolev-Yao system for rea- soning about cryptography and a translation from language

values to cryptographic messages. Sections 4 and 5 contain discussion and related work, respectively.

2 The SImp Language

2.1 Background and Example

As with other language-based approaches to information-flow security, the locations in our pro- gramming language are annotated with security labels. This paper uses a decentralized label model (DLM) variant where labels are lists of security policies with confiden- tiality and integrity components. These policies refer to principals, which are characterized by their access to private keys. A policy has form o : r! w, where r and w are sets of principals and o is a single principal. This means that policy owner o certifies that any principal in r can read from the associated location, and any principal in w can write. Sections 2.2 and 3.1 discuss the label model and private keys respectively. Although the literature discusses “the” DLM, there are several subtly different models. When they are handled at all, integrity constraints sometimes correspond to writers of data; other times to trusters. Additionally, DLM presen- tations typically contain an acts-for hierarchy: an explicit and nominal delegation relation. Here, we do not build an explicit acts-for hierarchy as it is not germane to our set- ting. Instead we investigate the orthogonal issues of collu- sion and cooperation among sets of principals. Section 5. discusses the acts-for hierarchy further. Before examining the formal description of SImp, we present the sample program shown in Figure 1. In this ex- ample we imagine a small client that can read and write data to a database shared by many users.^1 The database imple- ments a finite map signature, with no provisions for security. To model this situation, the database is labeled with a single policy: {db admin : everyone! everyone}. That is, data entered in to the database is readable by anyone; data read from it may have been altered by anyone. Input and output are performed by reading from and writing to designated memory locations. Lines 14 through 20 declare the locations corresponding to input, and line 23 declares a location corresponding to the ter- minal. Locations action and position describe the pro- gram’s mode of operation—whether to read or write and where. Tagged with security label {p : everyone! p}, their contents are readable by everyone and have only been influ- enced by one principal, p. The label on txt is more restric- tive; its contents are only readable by p. That is, txt con- tains a secret. The database is promiscuous; it produces and (^1) For convenience we have augmented SImp with syntactic sugar, method calls, strings, and a unit type.

we intend for p reads (resp. p writes) to hold when the members of p can cooperate to read (write) at . Sec- tion 5.1 compares our presentation of a DLM with several others, including Myers and Liskov’s original description. In a DLM, principals typically represent users of a sys- tem. We call the set of all principals P, and assume it is finite. We also assume the existence of a canonical total or- dering on P; this is not the acts-for hierarchy, but a helpful condition used for defining functions over labels. Informally, a label consists of several policies in which principals called owners make access control statements. Each policy has form o : r! w, and consists of an owner o, a set of readers r, and a set of writers w. When attached to a piece of data, such a policy means that owner o certifies that the data can be read only with the authority of o or of some principal in r. Similarly, p can only write such data when p is o or in w. Formally, a DLM label is function of type P → 2 P^ × 2 P^. Notation = {o 1 : r 1! w 1 ; o 2 : r 2! w 2 } abbreviates

`(o) =

(r 1 , w 1 ) o = o 1 (r 2 , w 2 ) o = o 2 (P, ∅) otherwise.

The projections (o 1 ).C and(o 2 ).I give r 1 and w 2. Be- cause principals are totally ordered, functions (predicates) may be defined by recursion (induction) as if labels were lists of policies. The inequality 1 ≤ 2 holds when

∀o. 2 (o).C ⊆ 1 (o).C ∧ 1 (o).I ⊆ 2 (o).I.

The confidentiality of the policy defined by C(o : r! w) = o : r! ∅; integrity is defined by I(o : r! w) = o : P! w. These definitions generalize to labels in the natural way. If = 1 t ` 2 then

(o) = ( 1 (o).C ∩ 2 (o).C, 1 (o).I ∪ ` 2 (o).I).

Predicates for reading and writing hold when princi- pals can cooperate to read or write labeled data. Predicate p reads is defined to be true iff ∀o. ∃p ∈ p. p ∈ {o} ∪(o).I, and p writes when ∀o. ∃p ∈ p. p ∈ {o} ∪(o).C. Intuitively, p can read (write) when every owner permits at least one member of p to read (write). As a notational convenience, we will write {p 1 , p 2 : r! w} for {p 1 : r! w; p 2 : r! w}. It’s clear that the most restrictive label, {>}, is {P : ∅! P}, and the least restrictive label, {⊥}, is {P : P! ∅}.

Lemma 1. The DLM is an instance of a security lattice.

2.3 SImp Syntax

SImp is based on Winskel’s IMP language [34] and the simple security language by Volpano, Smith, and

Irvine [33]. SImp is stratified into pure expressions and im- perative commands. We examine the language starting with syntax, then work from dynamic to static semantics. The following grammar gives the syntax of SImp:

Types τ ::= int | τ 1 + τ 2 | pkg Integers i ::=... − 1 | 0 | 1... Values v ::= i | inl v | inr v | 〈v〉Expressions e ::= i | a | x | inl e | inr e | e 1 + e 2 | 〈v〉 | pack e at | unpack e as τ {} |... Commands c ::= skip | x := e | c 1 ; c 2 | while e do c | case e of a 1 ⇒ c 1 | a 2 ⇒ c 2

Expressions may of course be augmented with additional operations on ints as necessary. Pairs of types and labels, written τ {}, describe the shape of an expression and its security policy. Such pairs are called labeled types. We distinguish variables from locations. Variables, ranged over by a, are bound in case commands and replaced by substi- tution. Locations, ranged over by x, are never substituted away and are used to read from and write to memory. The new constructs for abstract encryption include pack- ages 〈v〉, pack, and unpack. The package 〈v〉` is intended to have several properties:

  1. v must only be read by programs with sufficient au- thority to read `.
  2. v must be kept confidential in accordance with C(`).
  3. v must only be written to by programs with authority to write `.
  4. v must have only been influence by data with integrity greater than I(`).

The third property restricts package creation in SImp; it would be a more powerful statement if SImp supported first- class pointers and structures. Expression pack v at constructs package 〈v〉. Ex- pression unpack v as τ {} attempts to interpret v as a pack- age 〈v 0 〉 0 where v 0 has shape τ and where 0 ≤. Logi- cally, pack and unpack serve as introduction and elimina- tion rules for pkg. Expression forms pack e at and 〈v〉 are not redundant—pack is an expression that may fail at runtime; 〈v〉` is the result of a successful pack. No primitive type describes booleans or errors, but we encode them with the following abbreviations: bool = int + int

truei = inl i falsei = inr i

error = int insufficientAuth = 0 illegalFlow = 1 typeMismatch = 2

Typically the index of true or false is unimportant and will be omitted. Additionally, if e then c 1 else c 2 is shorthand for case e of a 1 ⇒ c 1 | a 2 ⇒ c 2 where a 1 and a 2 do not appear in c 1 or c 2.

2.4 Dynamic Semantics

SImp programs are run with the authority of some set of principals. Intuitively, a program run with Alice’s au- thority can sign and decrypt with her private key. Author- ity is represented by a set of principals and appears in the p component of the command and expression evaluation rules (Figures 2 and 3). Expressions do not have side effects but can read mem- ory. Thus expressions must be evaluated in contexts con- taining a memory, M. Memories are finite maps from locations to values. Most expressions, but not pack and unpack, are standard. As show by rules EE-PACK-OK and EE-PACK-FAIL, ex- pression pack v at may evaluate in two ways. If dynamic check p writes succeeds, then the program is running with sufficient authority to write at . In this case, pack evalu- ates to inl 〈v〉. However, if the program cannot write at , an error results instead. While the dynamic behavior of pack is influenced by the writes relation, it is not a covert channel. The authority set p, label in the text of pack, and the definition of writes do not vary at run time. Therefore an attacker cannot gain information by observing whether a pack succeeds. Unpacks can fail in more ways than packs; this is re- flected in the three premises of EE-UNPACK-OK. Analo- gously to packing, unpack 〈v 0 〉0 as τ {} requires that p reads . However, the contents and label of 〈v 0 〉 0 are stat- ically unknown, and we must make two additional runtime checks. First, checking 0 ≤ ensures that the static infor- mation flow properties of SImp continue to protect v 0 after unpacking. Second, checking ` v 0 : τ (which typechecks v 0 to ensure it has type τ ) is required to avoid dynamic type errors. This check must be delayed until runtime; check- ing sooner is incompatible with the cryptographic semantics given in Section 3.2. The only unusual command is case. Tagged unions, such as inl 0 are consumed by case, which branches on the tag (i.e. inl) and substitutes the value (i.e. 0 ) for a bound variable in the taken branch. Evaluation rules EC- CASEL and EC-CASER define this behavior.

2.5 Static Semantics

SImp’s type system performs two roles. First, it provides type safety; this means that the behavior of well typed pro- grams is always defined. Second, the type system prevents high-to-low information flows except where permitted by

p; M ` e → e′

EE-LOC M (x) = v p; M ` x → v

EE-INL p; M e → e′ p; M inl e → inl e′

p; M e → e′ p; M inr e → inr e′^

EE-INR

p; M e 1 → e′ 1 p; M e 1 + e 2 → e′ 1 + e 2

EE-PLUS-STRUCT 1

p; M e → e′ p; M v + e → v + e′^

EE-PLUS-STRUCT 2

p; M ` i 1 + i 2 → i 3

EE-PLUS where [[i 3 = i 1 + i 2 ]]

p; M e → e′ p; M pack e at → pack e′^ at

EE-PACK-STRUCT

p writes p; M pack v at → inl 〈v〉

EE-PACK-OK

EE-PACK-FAIL ¬(p writes ) p; M pack v at ` → inr insufficientAuth

EE-UNPACK-STRUCT p; M e → e′ p; M unpack e as τ {} → unpack e′^ as τ {}

EE-UNPACK-FAIL 1 ¬(p reads ) p; M unpack 〈v 0 〉0 as τ {} → inr insufficientAuth

EE-UNPACK-FAIL 2 p reads 0  p; M unpack 〈v 0 〉0 as τ {} → inr illegalFlow

EE-UNPACK-FAIL 3 p reads 0 ≤ 6 v : τ p; M unpack 〈v 0 〉 0 as τ {`} → inr typeMismatch

EE-UNPACK-OK p reads 0 ≤ v 0 : τ p; M unpack 〈v 0 〉 0 as τ {`} → inl v 0

Figure 2. Expression Evaluation Relation

pc; Θ; Γ ` c

pc; Θ; Γ ` skip

TC-SKIP

Θ; Γ e : τ {e} Θ(x) = τ {}e t pc ≤ pc; Θ; Γ x := e

TC-ASSIGN

pc; Θ; Γ c 1 pc; Θ; Γ c 2 pc; Θ; Γ ` c 1 ; c 2

TC-SEQ

Θ; Γ e : bool{} pc t ; Θ; Γ c pc; Θ; Γ ` while e do c

TC-WHILE

Θ; Γ e : (τ 1 + τ 2 ){} pc t ; Θ; Γ[a 1 7 → τ 1 {}] c 1 pc t; Θ; Γ[a 2 7 → τ 2 {}] c 2 pc; Θ; Γ ` case e of a 1 ⇒ c 1 | a 2 ⇒ c 2

TC-CASE

pc′; Θ; Γ c pc ≤ pc′ pc; Θ; Γ c

TC-SUBS

Figure 5. Command Typing

program counter greater than the label of x. Treating the pc in this manner is necessary to protect against implicit flows. We also type case commands in this manner. The following program, which is rejected by the type system, has a dynamic information leak.

1 if h then 2 x := pack 0 at {⊥} 3 else 4 x := pack 0 at {>}; 5 case ( unpack x as int {⊥}) of 6 inl _ = > output := 1 / ∗ h t r u e ∗ / 7 inr _ = > output := 0 / ∗ h f a l s e ∗ /

We assume h has label {>} and output has label {⊥}. If h is true then unpacking succeeds, and output is assigned 1. In contrast, if h is false then output is assigned 0. Thus an attacker, who is authorized to read {⊥} but not {>}, could determine h by observing output. Fortunately the above program cannot be typed. As- sume x classifies x. Rule TC-CASE forces the pc to be {>} at line 2, and TC-ASSIGN requires pc ≤. Thus {>} ≤ x andx = {>}. On line 5 expression unpack x as int{⊥} can be assigned—by TE-UNPACK— label 0 where C( 0 ) = C(x) = C({>}). Rule TC- CASE requires that, on line 6, 0 ≤ pc. By TC-ASSIGN, pc ≤ {⊥}; so ` 0 = {⊥}. As is no way to satisfy both

v 1 ∼=` v 2

i ∼=` i

VE-INT

v 1 ∼=v 2 inl v 1 ∼= inl v 2

VE-INL

v 1 ∼=v 2 inr v 1 ∼= inr v 2

VE-INR

v 1 ∼=v 2 〈v 1 〉 1 ∼=〈v 2 〉 1

VE-PACK-IN

1 

〈v 1 〉1 ∼= 〈v 2 〉` 1

VE-PACK-LAB

Figure 6. Equivalent Values

0 = ⊥ and C( 0 ) = C({>}), the program is rejected.

2.6 Noninterference

This section establishes the noninterference information- flow property for well-typed SImp programs. Consider the terminating execution of program c in memory M 1 with re- sult M 1 ′. Now change some high security components of M 1 to obtain M 2 and, starting in M 2 , rerun c to get M 2 ′. If the low security parts of M 1 ′ are different from those M 2 ′ then c has leaked information. Instead, we would like to prove that the semantics of SImp ensure M 1 ′ and M 2 ′ are equivalent; that is, they differ only in their high security components. This property, noninterference, will be defined and formalized in the remainder of this section. To make noninterference precise, we define when two values are equivalent at a label. This is done inductively with the rules in Figure 6. The most interesting rule is VE- PACK-LAB. It states that an observer at label cannot dis- tinguish packages sealed at 1 when C(1 )  C(). We must also define when two commands or expressions are equivalent. We elide the inductive definitions of these re- lations. Intuitively e ∼=e′^ holds when e and e′^ are equiv- alent values, or identical productions applied to equivalent expressions. The definition of c ∼= c′^ is similar. Conventionally, noninterference treats memories as equivalent when the contents of corresponding low security locations are identical. We generalize this and allow equiv- alent memories to map low locations to equivalent, but not identical, values.

Definition 1 (Θ M 1 ∼= M 2 ). In context Θ, memories M 1 and M 2 are equivalent to an observer at level , written Θ M 1 ∼=M 2 , when dom(M 1 ) = dom(M 2 ) and ∀x ∈ dom(M 1 ). ∃τ,′. Θ(x) = τ {′} ∧ (M 1 (x) ∼= M 2 (x) ∨ ′^ ).

To avoid reasoning about stuck execution states, we assume commands are always run in well typed memo- ries. Eliminating stuck states (i.e. proving type soundness) both simplifies SImp’s metatheory and eliminates attacks through the runtime-error covert channel.

Definition 2 (Θ M OK ). A memory, M , is well typed in location context Θ, when ∀x ∈ dom(Θ). Θ(x) = τ {} ∧ M (x) : τ. This property is written Θ M OK.

A trace is a set of principals and a sequence of config- urations, (p, 〈M 1 , c 1 〉, 〈M 2 , c 2 〉,... , 〈Mn, cn〉), where for each i ∈ { 1 , n − 1 }, p ` 〈Mi, ci〉 → 〈Mi+1, ci+1〉.

Lemma 2 (Trace determinancy). There is at most one shortest trace of form (p, 〈M 1 , c 1 〉,... , 〈Mn, cn〉).

If such a trace exists, we will write it as p 〈M 1 , c 1 〉 →∗ 〈M 2 , c 2 〉. The two following non-interference theorems are the pri- mary language-theoretic results for SImp. The first states that if-equivalent expressions, e 1 and e 2 , can be typed with label , then evaluating them in-equivalent memories, M 1 and M 2 , yields `-equivalent results, v 1 and v 2. That is, eval- uation of low-security expressions occurs independently of high security inputs.

Theorem 1 (Expression Non-interference). If

  • Θ M 1 OK , Θ M 2 OK and Θ M 1 ∼= M 2
  • Θ; · e 1 : τ {e} and e 1 ∼=e 2 wheree ≤ `
  • p; M 1 e 1 →∗^ v 1 and p; M 2 e 2 →∗^ v 2

then v 1 ∼=` v 2.

The second theorem extends this to configurations, and states that `-equivalence is preserved by terminating com- putations. These theorems are more general than those of Smith and Volpano [33] who do not account for equivalent but unequal values. Additionally, they are substantially sim- pler than the the robust declassification and qualified robust- ness theorems needed in the case of general endorsement or declassification [10, 23].

Theorem 2 (Command Noninterference). If

  • Θ M 1 OK , Θ M 2 OK and Θ M 1 ∼= M 2
  • pc; Θ; · c 1 and c 1 ∼= c 2
  • p 〈M 1 , c 1 〉 →∗^ 〈M 1 ′, skip〉 and p 〈M 2 , c 2 〉 →∗ 〈M 2 ′, skip〉

then Θ M 1 ′ ∼= M 2 ′.

The language level definitions and theorems treat con- fidentiality and integrity uniformly. This is a reflection of a well known duality between “tainted” and “secret” val- ues and “untainted” and “public” values. This duality also arises in the cryptographic semantics described next, where confidentiality is enforced via encryption and integrity is enforced via digital signatures.

3 Cryptographic Semantics

The above noninterference property ensures security for programs run in a trusted environment. We wish to also con- sider hostile environments: Can we interpret labels using cryptography to ensure information flow guarantees hold in open systems? To examine this issue, we first define a formal syntax of messages and a Dolev-Yao deduction system for reasoning about them. Next, we show how to compile SImp values into messages and establish that compiled packages imple- ment appropriate confidentiality policies. Last, we relate memories and commands to messages in order to define and prove a cryptographic noninterference theorem. Note that we rely on the soundness of Dolev-Yao reasoning with respect to computational bounded attackers in the style of Abadi and Rogaway [3] and of Backes and Pfitzmann [6]. We make several general assumptions. Each principal has a corresponding public/private key pair. All public keys are known to all principals, and private keys are known only to the corresponding principal. Key distribution and name binding are orthogonal (but important) problems that are not considered here.

3.1 Messages and Message Analysis

This section defines messages, cryptographic states, and an inference system for reasoning about them. Messages are the basic objects in the cryptographic semantics. Cryp- tographic states are collections of messages that represent knowledge, ability, and belief. Lastly the inference system describes when new messages can be synthesized from an cryptographic state. Messages are defined by the following grammar:

Principals p, q, r ::= Alice | Bob |... Key Id κ, W, R (abstract) Private Keys K−^ ::= K κ− Public Keys K+^ ::= K κ+ Strings str ::= "a"|"b" |... Messages m, n ::= str | K | p | (m, m′) | enc(K , m) | sign(K , m)

The metavariable K ranges over both public and private keys. Message enc(K , m) means m encrypted by K ,

σ `d m

(knows m) ∈ σ σ `d m

D-TAUT

σ u K σd m σ `d enc(K , m)

D-ENCRYPT

σ d enc(K κ+ , m) σu K− κ σ `d m

D-DECRYPT

σ u K σd m σ `d sign(K , m)

D-SIGN

σ d sign(K , m) σd m

D-SIGN-ID

σ b m σd m

D-LIFT

σ d enc(K , m) σd K

D-ENC-ID

σ d (m 1 , m 2 ) σd m 1

D-PAIRL

σ d (m 1 , m 2 ) σd m 2

D-PAIRR

σ d m 1 σd m 2 σ `d (m 1 , m 2 )

D-PAIR

σ `u m

U-TAUT (actswith m) ∈ σ σ `u m

U-LIFT σ d m σu m

σ `b m

B-TAUT (believes m) ∈ σ σ `b m

B-SIGN-VERIFY σ d sign(K−, m) σb K+ σ `b m

Figure 7. Cryptographic Deduction System

cies list to to a list of seals.

L[[(π 1... πn)]]R 1 ,W 1 ,...Rn,W n = [P[[π 1 ]]R 1 ,W 1... P[[πn]]Rn,W n]

Once is translated to an envelope, we can proceed with translating 〈v〉. First we recursively translate v to obtain V[[v]]. Next we write into the envelope by encrypting V[[v]] with each seal’s K− R and signing with K W− key. The result is paired with the list of seals. Formally, the value translation is given by

V[[i]]κ = "i" V[[inl v]]κ = ("inl", V[[v]]κ) V[[inr v]]κ = ("inr", V[[v]]κ) V[[〈v〉]]κ 1 ,κ 2 = (doPack κ 2 V[[v]]κ 1 , L[[]]κ 2 )

where

doPack (R 1 , W 1 ,... , Rn, Wn) m = es(Rn, Wn,... es(R 1 , W 1 , m).. .) es(R, W, m) = sign(K− W , enc(K R+ , m)).

Entire memories are translated to cryptographic states by packing each location’s contents:

M[[·]]Θ κ = ∅ M[[M [x 7 → v]]]Θ κ,κ′ = M[[M ]]Θ κ , knows V[[〈v〉]]κ′ (where Θ(x) = τ {})

To correctly thread κ though the above calculation, we as- sume that locations in a program are translated in a fixed order. Picking an order is easy, as memories are finite and the choice of order is arbitrary.

3.3 Cryptographic Analysis

We model the execution of a SImp program by an evolv- ing cryptographic state that reflects the program’s dynamic memory contents. To do this we will define equivalence relations on messages and cryptographic states, then show that the translation functions from Section 3.2 preserve equivalences. Lastly, we introduce state transition rules for cryptographic states and argue that command evaluation corresponds to state evolution. First we connect the cryptographic system and our DLM. The predicate σ  p holds when ∀p ∈ p.σ u K p−. The relation σ m ∼= m′^ means that in state σ messages m and m′^ are indistinguishable. It is inductively defined by the rules in Figure 8. Rule ME-ID states that identical terms are indistinguishable. Rule ME-ENC-SECRET assumes perfect cryptographic operations. In particular, ME-ENC-SECRET states that if two messages cannot be decrypted, they are equivalent—you cannot provide evidence that they do not encrypt equivalent values. The rule ME-PAIR says that in- formation from the left sides of pairs is considered when checking the right sides, and vice versa. This is necessary to avoid erroneously deriving that (K , enc(K , "a")) ∼=` (K , enc(K ′, "b")). Rule ME-SIGN-SUSPECT requires explanation. It states that two messages are equivalent when they are signed by untrusted keys. From the perspective of an honest user, this makes perfect sense. Honest players will ignore signed messages that they do not trust. It also makes sense from the perspective of the attacker. A Dolev-Yao attacker only desires to construct (or deconstruct) messages he should not be allowed to do. This aspect of signatures is handled by D- SIGN and D-SIGN-ID. While an attacker might swap two

σ ` m 1 ∼= m 2

σ ` m ∼= m

ME-ID

σ, knows m 2 , knows m′ 2 m 1 ∼= m′ 1 σ, knows m 1 , knows m′ 1 m 2 ∼= m′ 2 σ ` (m 1 , m 2 ) ∼= (m′ 1 , m′ 2 )

ME-PAIR

σ m 1 ∼= m 2 σ enc(K , m 1 ) ∼= enc(K , m 2 )

ME-ENC-STRUCT

σ 6 u K 1 − σ 6u K 2 − σ ` enc(K 1 + , m 1 ) ∼= enc(K+ 2 , m 2 )

ME-ENC-SECRET

σ m 1 ∼= m 2 σ sign(K , m 1 ) ∼= sign(K , m 2 )

ME-SIGN-STRUCT

σ 6 b K+ 1 σ 6b K 2 + σ ` sign(K 1 − , m 1 ) ∼= sign(K 2 − , m 2 )

ME-SIGN-SUSPECT

Figure 8. Contextual Message Equivalence

equivalent messages, he will only be able to fool an honest participant who does not believe the keys used to sign the messages; this is harmless. The next four definitions extend the notion of `- equivalence to messages.

Definition 3 (σ reads ). If ∃p.(p reads ∧ ∀p ∈ p.σ u K p− ) then σ reads.

Definition 4 (σ distrusts ). If ∃p.(p writes ∧ ∀p ∈ p.σ 6 b K p− ) then σ distrusts.

Definition 5 (σ ≤ ). If ¬σ reads and σ distrusts then σ ≤.

Definition 6 (Message -equivalence: m ∼= m′). We write m ∼=` m′^ if and only if

∀σ. σ ≤ =⇒ σ, knows m, knows m′^ m ∼= m′ For example, assume K− R is fresh, then consider the mes- sages

m = (enc(K p+ , K R− ), enc(K R+ , "3")) m′^ = (enc(K p+ , K R− ), enc(K R+ , "4"))

and the label = {o : pq! P}. Is it true that m ∼= m′? To find out, we take arbitrary σ where σ ≤ . Unfolding Defi- nition 5 shows ¬(σ reads). Therefore, because p reads , we conclude σ 6u K p−. Now let

σ′^ = σ, knows (enc(K p+ , K− R )) σ′′^ = σ′, knows m, knows m′.

` σ → σ′

` σ → σ, knows (K+ κ , K κ− )

CS-FRESH κ fresh

CS-DERIVE σ d m σ → σ, knows m

CS-FORGET σ′^ ⊆ σ ` σ → σ′

CS-COMPUTE σ d "i 1 " σd "i 2 " ` σ → σ, "i 3 "

where i 3 = i 1 + i 2

Figure 9. Cryptographic State Transitions

From σ 6 u K− p and the freshness of K R− , it is clear that σ′^6d K R− and that σ′′^6 d K R−. Therefore σ′′^ enc(K+ R , "3") ∼= enc(K R+ , "4") by ME-ENC-SECRET. Applying ME-PAIR yields σ′^ m ∼= m′. Finally gener- alizing over σ and applying Definition 6 gives m ∼= m′. The messages m and m′^ contain the key components of V[[〈 3 〉{o:p! }]] and V[[〈 4 〉{o:p! }]]. Demonstrating their - equivalence here is intended to be suggestive, and this rela- tion will be made precise by Lemma 3. First, however, we must lift-equivalence to cryptographic states.

Definition 7 (σ ∼=σ′). If knows m ∈ σ implies that there exists m′^ where knows m′^ ∈ σ′^ and m ∼= m′, then σ′^ σ. If σ′^  σ and σ σ′, then σ ∼= σ′.

Thus far we have defined two sorts of equivalence rela- tions: those at the SImp level and those at the cryptographic level. However, it is not yet clear what, if any, formal re- lation exists between, say, value and message equivalences. For our cryptographic semantics to provide a safe interpre- tation of of SImp, equivalent values (memories) must trans- late to equivalent messages (states). Otherwise, an attacker could illegally gain information by observing the crypto- graphic states corresponding to the beginning and end of a well-typed program’s execution. The following lemma and corollary state that this cannot occur.

Lemma 3 (Adequacy of Value Translation). If v 1 ∼=v 2 and κ is fresh then V[[v 1 ]]κ ∼= V[[v 2 ]]κ.

Corollary 1 (Adequacy of Memory Translation). If Θ M 1 ∼= M 2 and κ is fresh then M[[M 1 ]]Θ κ ∼=` M[[M 2 ]]Θ κ.

Coupled with Theorem 2, these demonstrate that our cryptographic system reflects language level noninterfer- ence. Thus Lemma 3 and its corollary are the statements that our cryptographic system is safe. Above, we showed that SImp and its cryptographic in- terpretation are safe. However, safety and implementabil- ity are orthogonal issues. For example, the translation that

KDLM security typing is nominal—labels have names and each name corresponds to a unique cryptographic key. While they prove type soundness, Chothia and colleagues do not provide more specific security theorems such as non- interference. Our pack/unpack language feature can be compared with both dynamic types [2] and standard existential types [24]. Like typecase, unpack may fail at runtime; the stan- dard existential unpack always succeeds. As with dynam- ic/typecase, our pack/unpack does not provide direct sup- port for abstract datatypes; existentials usually do. A more refined approach to pack/unpack might use type annota- tion to expose the internal structure of encrypted values; this would resemble a existential package with a bounded type variable. Sumii and Pierce [31] studied λseal, an extension to lambda calculus with terms of form {e}e′ , meaning e sealed-by e′, and a corresponding elimination form. Like Askarov and colleagues, they make seal (i.e. key) genera- tion explicit in program text; however their dynamic seman- tics, which include runtime checking of seals, is simpler than Askarov’s. λseal includes black-box functions that an- alyze sealed values, but cannot be disassembled to reveal the seal (key). It is not clear how to interpret such functions in a cryptographic model. Heintze and Riecke’s SLam calculus [19] is an infor- mation flow lambda calculus in which the right to read a closure corresponds to the right to apply it. This sidesteps the black-box function issue from λseal. In SLam, some expressions are marked with the authority of the func- tion writer. The annotations control declassification, and, we conjecture, are analogous to the pretranslated labels in SImp. Additionally SLam types have a nested form where, for example, the elements in a list and the list itself may be given different security annotations. Combined with pack, such nesting could facilitate defining data structures with dynamic and heterogeneous security properties. We use the algebraic Dolev-Yao model to study the con- nection connection between information flow and cryptog- raphy. Laud and Vene [21] examined this problem using a computational model of encryption. More recently, Smith and Alp´ızar extended this work to include a model of de- cryption [30]. They prove noninterference for a simple lan- guage without declassification (or packing) and a two-point security lattice. Like Chothia and colleagues, they map la- bels to fixed keys. Abadi and Rogaway proved that Dolev-Yao analysis is sound with respect to computational cryptographic analysis in a setting similar to our own [3]. While the inference sys- tem in Figure 7 was influenced by their formalism, there are significant differences in approach. In particular, Abadi and Rogaway do not discuss public key cryptography, which we use extensively. Backes and Pfitzmann [6] with Waidner [7]

have also investigated the connection between symbolic and computational models of encryption. They define a Dolev- Yao style library and show that protocols proved secure with respect to library semantics are also secure with respect to computational cryptographic analysis. This library might provide an excellent foundation for further rigorous analy- sis of SImp.

5 Discussion

Information flow languages often provide escape hatches to declassify secrets or endorse untrusted input. While these mechanisms allow violations of language policies, they iso- late locations where leaks can occur and are quite useful in practice. Unfortunately, languages with unrestricted de- classification and endorsement no longer enjoy simple non- interference, leading to complex metatheory [10]. SImp’s pack and unpack operators provide a middle ground. Like declassify, pack lowers confidentiality policies, and, like endorse, unpack lowers integrity label policies. However, packing and unpacking are not as general as declassifica- tion and endorsement. For example, pack/unpack cannot be used to make public the result of a password check—a clas- sic use of declassification. The advantage of pack/unpack, is that they preserve non-interference and are thus safer than declassify/endorse. Thus these constructs are complemen- tary. We believe a practical information flow language could include both.

5.1 Comparison with other DLMs

Several decentralized label models are discussed in the literature. As originally formulated by Myers and Liskov, structurally defined labels described only confidentiality (or, dually, integrity) policies [22]. Later research treated confidentiality and integrity simultaneously. Zdancewic and Tse examined a DLM where integrity polices define a “trusted by” relation [32]. In contrast, Myers and Chong treat integrity as we do, with the “written by” interpreta- tion [10]. Lastly, Chothia, Duggan, and Vitek’s KDLM blends structural and nominal label semantics [12]. Our DLM differs significantly from Myers and Liskov’s original presentation [22], which gives labels a more restric- tive interpretation. For example, in our setting label

` = {Alice : Alice, Charlie! ∅; Bob : Bob, Charlie! ∅}

can be read with the authority of {Alice, Bob} or just Charlie. Myers requires Charlie’s authority to read `. (Of course, Alice and Bob may conspire to first declassify and then read—but it’s important not to conflate this with sim- ple reading.) Our choice of interpretation was motivated by the constraints inherent in cryptographically translating

packages. In particular, Lemma 3 would not hold under Myers and Liskov’s interpretation. However, we could re- tain this result by changing the definition of V[[·]]· to use share semantics. Under share semantics, 〈v〉is translated by generating a fresh key pair and encrypting v with the public key. Cryptographic shares of the fresh keys are dis- tributed according to each owner’s read and write policy. With mutual distrust among owners, no owner should be able to learn the fresh keys except as permitted by the reads and writes relations. This requires generating key shares without revealing the underlying keys. We hoped to do so with threshold cryptography [15], but current approaches expose one key of the pair. Previous DLMs include a partial order on principals called the acts-for hierarchy [22]. If p  q then principal p is assumed to have the authority of q. If σ is p’s crypto- graphic state, σu K q− models this acts-for relation in our setting. This is a course-grained form of delegation. The correct cryptographic implementation of the acts for hier- archy is not clear. A naive implementation might provide Alice with Bob’s private key when Alice  Bob. However this has practical shortcomings: revocation is impossible, and Bob cannot selectively grant Alice rights. A more so- phisticated protocol might require that Bob provide Alice with a network service or a smart card that can selectively provide encryption and signing services.

5.2 Language Extensions

SImp is a core language for programming with informa- tion flow and packing. Future work may extend it with sev- eral new constructs. Currently SImp programs must unpack packages to com- pute with their contents. Alternatively, the rule

p; M v 1 + v 2 → v 3 p; M 〈v 1 〉+ 〈v 2 〉 → 〈v 3 〉`

BIND

would permit computation within packages. (The name BIND follows the monadic interpretation of security state- ments in Abadi’s Dependency Core Calculus [1].) While BIND can be implemented using the homomorphic proper- ties of the Goldwasser-Micali cryptosystems, they cannot sustain an analogous multiplication rule. Other systems (e.g. RSA) would support multiplication but not addition. Unfortunately, current cryptosystems can only provide effi- cient homomorphic computation over a single algebraic op- erator. A more general bind would require an efficient ho- momorphic algebraic (i.e. additive and multiplicative) cryp- tosystem; the existence of such schemes is an open prob- lem [26]. Imperative update of packed values is compatible with SImp’s semantics. The operational semantics might look

like p writes p; M put v in 〈v 0 〉→ inl 〈v〉

PUT .

PUT assigns a low (trusted, public) value into a high (tainted, secret) package; this is straightforward to type- check and dynamically safe. What distinguishes packing and writing? Compiling a pack requires the creation of a new envelope, which in turn requires the owners’ keys. In contrast, a put reuses dynamically acquired envelopes and requires no compile-time keys. Our model assumes that programs are compiled with the authority of all owners; thus PUT conveys no particular advantage. It may be useful un- der weaker assumptions, such as those encountered in the context of program partitioning [35]. Lastly, SImp could allow programs to strengthen the la- bel of a (potentially unreadable) package. In full generality,

1 ≤ 2 p; M strengthen 〈v〉 1 to 2 → 〈v〉 2

STRENGTHEN .

In the case of a DLM, 2 may be more restrictive than 1 in two ways: 2 may have new that policies 1 does not, or 2 may have more restrictive policies than 1. In the former case, it is straightforward to append the new policy’s seal to 1 ’s envelope and finish the construction of V[[〈v〉 2 ]]. How- ever, it is not clear what to do in the second case.

Conclusion It is important to consider the interplay be- tween cryptography and information-flow in the context of language-based security. This paper has investigated one design for high-level language features that make it easy for to connect a secure program’s confidentiality and integrity labels with an underlying cryptographic implementation. Our package mechanism complements existing, more gen- eral approaches to downgrading, but has the advantage of yielding a strong noninterference result against Dolev-Yao attackers. We expect that such packages will be useful for building systems that enforce strong security policies, even when confidential data must leave the confines of the trusted run-time environment.

Acknowledgments We would like to thank the anony- mous reviewers for their helpful comments and Peeter Laud for his suggestions regarding the cryptographic semantics.

References

[1] M. Abadi. Access control in a core calculus of depen- dency. In ICFP ’06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional Program- ming, pages 263–273, Portland, Oregon, USA, September