• Nie Znaleziono Wyników

Turing machines and computer viruses

N/A
N/A
Protected

Academic year: 2021

Share "Turing machines and computer viruses"

Copied!
54
0
0

Pełen tekst

(1)

viruses

Luite van Zelst

Institute for Logic, Language and Computation University of Amsterdam

3rd International Workshop on the Theory of Computer Viruses, 2008

(2)

1

Motivation

2

Turing machines

Modern Turing machines Turing’s original machine

3

Computer viruses

Interpreted Sequences Cohen’s viruses

(3)

“A virus may be loosely defined as a sequence of symbols which, upon interpretation, causes other sequences of symbols to contain (possibly evolved) virus(es).” (Fred Cohen)

(4)

The definition

Let M be a Turing machine and V ⊆ Σ then hM, V i ∈ VS if

∀v ∈ V , h ∈ HM (1)

if ∃ n1< ω (2)

∧ h(0) = hs0, _, _i (3)

∧ h(n1) = hs0, t1, p1i (4)

∧ t1[p1, |v |] = v (5)

then ∃ v0∈ V , n2< ω, pos < ω (6)

∧ h(n2) = h_, t2, _i (7)

∧ t[pos, |v0|] = v0 (8)

∨ pos ≥ p1+ |v | (9)

∨ p1≥ pos + |v0| (10)

∧ ∃ n3< ω (11)

∧ n1< n3< n2 (12)

∧ h(n3) = hs3, t3, p3i (13)

∧ pos ≤ p2≤ pos + |v0| (14)

(5)

M Y V I R U S . . .

TM

Contiguous sequences (strings) Any substring on the tape

Uses a special flavour of Turing machines

(6)

M Y V I R U S . . .

TM

Contiguous sequences (strings) Any substring on the tape

Uses a special flavour of Turing machines

(7)

Depicted

s0 v time n1

v00 time n2

v0 time n3

(8)

Literature

Thimbleby et al. in 1998: A Framework for Modelling Trojans and Computer Virus Infection

Mäkinen in 2001: Comment on ‘A Framework for Modelling . . . ’

(9)

How are Turing machines defined precisely?

How are ‘interpreted sequences’ defined?

(10)

Davis (1958), Minsky (1967), Hopcroft et al. (1979):

Turing machine computes a function:

input M output

On computable numbers, with an application to the Entscheidungsproblem, Turing, 1936

Machine that computes an infinite sequence M

1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 . . .

(11)

Davis (1958), Minsky (1967), Hopcroft et al. (1979):

Turing machine computes a function:

input M output

On computable numbers, with an application to the Entscheidungsproblem, Turing, 1936

Machine that computes an infinite sequence M

1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 . . .

(12)

Infinite tape

Infinite tape: t : ω → Σ

Finite content:  /∈ Σ represents an empty square Infinite tape: t : ω → Σ ·∪ {}

Pure content: PΣ Σ

0 1 0 1 0     . . . PΣ in one-one correspondence with Σ

(13)

Infinite tape

Infinite tape: t : ω → Σ

Finite content:  /∈ Σ represents an empty square Infinite tape: t : ω → Σ ·∪ {}

Pure content: PΣ Σ

0 1 0 1 0     . . . PΣ in one-one correspondence with Σ

(14)

Infinite tape

Infinite tape: t : ω → Σ

Finite content:  /∈ Σ represents an empty square Infinite tape: t : ω → Σ ·∪ {}

Pure content: PΣ Σ

0 1 0 1 0     . . . PΣ in one-one correspondence with Σ

(15)

Infinite tape

Infinite tape: t : ω → Σ

Finite content:  /∈ Σ represents an empty square Infinite tape: t : ω → Σ ·∪ {}

Pure content: PΣ Σ

0 1 0 1 0     . . . PΣ in one-one correspondence with Σ

(16)

Definition

Structure hQ, Σ, tr , q0i where Q a finite set of states

Σ a finite set of tape symbols q0 starting state

tr is a transition function such that

tr : Q × (Σ ·∪ {}) → Q × Σ × {−1, 0, 1}

(17)

Moves

Configurations: hs, t, pi where state: s ∈ Q

tape: t : ω → Σ ·∪ {}

position: p < ω

Moves: hs, t, pi ,→hs0, t0, p0i

(18)

Computation

Computations: →M binary relation on infinite tapes t : ω → Σ ·∪ {}

t →M t0 ⇐⇒ hs, t, pi ,→nhs0, t0, p0i /,→

Condition 1: the machine start withhs0, t ∈ PB, 0i Condition 2: The machine does not write :

M⊆ (PB)2

M⊆ (Σ)2

(19)

Computation

Computations: →M binary relation on infinite tapes t : ω → Σ ·∪ {}

t →M t0 ⇐⇒ hs, t, pi ,→nhs0, t0, p0i /,→

Condition 1: the machine start withhs0, t ∈ PB, 0i Condition 2: The machine does not write :

M⊆ (PB)2

M⊆ (Σ)2

(20)

Computation

Computations: →M binary relation on infinite tapes t : ω → Σ ·∪ {}

t →M t0 ⇐⇒ hs, t, pi ,→nhs0, t0, p0i /,→

Condition 1: the machine start withhs0, t ∈ PB, 0i Condition 2: The machine does not write :

M⊆ (PB)2

M⊆ (Σ)2

(21)

Semantics

Basic: |M| : Σ → Σ

Function on naturals: encode input and output Representing all functions: one extra ‘erasure’ symbol

(22)

Computable Numbers

In 1936, Turing wrote: On computable numbers, with an application to the Entscheidungsproblem.

Real numbers

Binary expansion: π = 11, 001001000011111101 . . . Non integer part: infinite sequence

Computable numbers

Binary expansion written by a machine ? Computable sequences

(23)

Computable Numbers

In 1936, Turing wrote: On computable numbers, with an application to the Entscheidungsproblem.

Real numbers

Binary expansion: π = 11, 001001000011111101 . . . Non integer part: infinite sequence

Computable numbers

Binary expansion written by a machine ? Computable sequences

(24)

Computable Numbers

In 1936, Turing wrote: On computable numbers, with an application to the Entscheidungsproblem.

Real numbers

Binary expansion: π = 11, 001001000011111101 . . . Non integer part: infinite sequence

Computable numbers

Binary expansion written by a machine ? Computable sequences

(25)

Conditions

Mark the left-hand side Figures: ‘output’

Auxiliaries: ‘notes’

F -squares

A contiguous sequence of figures Not erasable (‘write-once’) E -squares

a kind of scratchpad

(26)

Conditions

B B

Mark the left-hand side Figures: ‘output’

Auxiliaries: ‘notes’

F -squares

A contiguous sequence of figures Not erasable (‘write-once’) E -squares

a kind of scratchpad

(27)

Conditions

B B 0 1 0 1 1

Mark the left-hand side Figures: ‘output’

Auxiliaries: ‘notes’

F -squares

A contiguous sequence of figures Not erasable (‘write-once’) E -squares

a kind of scratchpad

(28)

Conditions

B B 0 1 $ 0 1 1 $

Mark the left-hand side Figures: ‘output’

Auxiliaries: ‘notes’

F -squares

A contiguous sequence of figures Not erasable (‘write-once’) E -squares

a kind of scratchpad

(29)

Conditions

B B 0 1 $ 0 1 1 $

Mark the left-hand side Figures: ‘output’

Auxiliaries: ‘notes’

F -squares

A contiguous sequence of figures Not erasable (‘write-once’) E -squares

a kind of scratchpad

(30)

Conditions

B B 0 1 $ 0 1 1 $

Mark the left-hand side Figures: ‘output’

Auxiliaries: ‘notes’

F -squares

A contiguous sequence of figures Not erasable (‘write-once’) E -squares

a kind of scratchpad

(31)

Computed sequence

Computable sequence

0 1 0 1 1 0 1 1 1 0 . . .

Function output

Σ

0 1 0 1 1 0 1 1 1 0       . . .

(32)

Computed sequence

Computable sequence

0 1 0 1 1 0 1 1 1 0 . . .

Function output

Σ

0 1 0 1 1 0 1 1 1 0       . . .

(33)

Computed sequence

Computable sequence

0 1 0 1 1 0 1 1 1 0 . . .

Function output

Σ

0 1 0 1 1 0 1 1 1 0       . . .

(34)

On Turing machines

M Y V I R U S . . .

TM

Can we define a virus as a (contiguous) ‘sequence of symbols’

that is ‘interpreted’ by a Turing machine?

(35)

On Turing machines

M Y V I R U S . . .

TM

Can we define a virus as a (contiguous) ‘sequence of symbols’

that is ‘interpreted’ by a Turing machine?

(36)

For modern Turing machines

Turing machine: computes a function fully determined by transition function Universal machine:

Computes the universal function

Computes the function of some other machine Defining a Universal machine:

Encode the transition function: ‘program’

Encode the input to this machine: ‘input’

Encodings: injective and therefore decodable

(37)

For modern Turing machines

Without specifying ‘valid’ encodings Any machine ‘interprets’ any input Empty string ‘encodes’ the machine itself Entire input ‘encodes’ a constant function Just one program

Interleaving of ‘program’, ‘input’ and simulated tape and temporary symbols

Not every substring of the (total) input is interpreted

(38)

For modern Turing’s original machines

Turing’s original machine:

no input

no interpreted sequences Turing’s universal machine:

itself unlike Turing’s original machines

the entire input is the encoding of exactly one machine F - and E -squares: program is not a contiguous sequence on the tape

(39)

For modern Turing’s original machines

Turing’s original machine:

no input

no interpreted sequences Turing’s universal machine:

itself unlike Turing’s original machines

the entire input is the encoding of exactly one machine F - and E -squares: program is not a contiguous sequence on the tape

(40)

Model at least two programs Non-program cannot be a virus Standard models inadequate New (universal) Turing machine?

No benefit: non standard

(41)

Model at least two programs Non-program cannot be a virus Standard models inadequate New (universal) Turing machine?

No benefit: non standard

(42)

tape: ω → Σ

infinite tape with infinite content compare with t : ω → Σ ·∪ {}

starting state & position undefined transition function unrestricted

tr : K × Σ → K × Σ × {−1, 0, 1}

even with  ∈ Σ finite content undecidable

(43)

tape: ω → Σ

infinite tape with infinite content compare with t : ω → Σ ·∪ {}

starting state & position undefined transition function unrestricted

tr : K × Σ → K × Σ × {−1, 0, 1}

even with  ∈ Σ finite content undecidable

(44)

tape: ω → Σ

infinite tape with infinite content compare with t : ω → Σ ·∪ {}

starting state & position undefined transition function unrestricted

tr : K × Σ → K × Σ × {−1, 0, 1}

even with  ∈ Σ finite content undecidable

(45)

Not a modern Turing machine

Not Turing’s original (universal) machine All sequences trivially computable

No distinction between figures and auxiliaries No distinction between F -squares and E -squares

(46)

Can the difference between Cohen’s machine and modern Turing machines be overcome?

Viral equivalence: M ≡vir N if:

hM, V i ∈ VS ⇐⇒ hN, V i ∈ VS

Viral equivalence is incomparable to functional equivalence

No, it cannot.

(47)

Precise definitions essential for Turing machines Turing machines are inappropriate to model viruses Cohen’s modelling non-standard

Outlook

Open door for other modellings of computer viruses Dissect Turing’s machine and unify the two Turing machine models: ‘Talkative Machine’ (TM)

(48)

Thank you for your attention!

(49)

in

t

out M

M

N

in

t t

out M

M

N

N

(50)

vir

* ≡

func

M = hQ, Σ, tr , q0i N = hQ, Σ, tr0, q0i Σ = {a, b} Q = {q0, q1} tr (q0, _) = hq1, a, 0i tr0(q0, _) = hq1, b, 0i

Virally equivalent (trivially) No functionally equivalent:

|M|func = t 7→ t[0 7→ a]

|M|func = t 7→ t[0 7→ b]

(51)

vir

+ ≡

func

Two machines that compute x 7→ x · 1.

q0

q3

any,any,R

,1,N

q0 q1

q2

q3

any,any,R

,0,N

0,0,N

0,1,N

(52)

beamericonbookM. Davis.

Computability and unsolvability.

McGraw-Hill, 1958.

beamericonbookM. Minksy.

Computation : finite and infinite machines.

Prentice-Hall, 1967.

beamericonbookJ. Hopcroft and J. Ullman.

Introduction to Automata Theory, Languages, and Computation.

Addison Wesley, 1979.

(53)

beamericonbookB.J. Copeland.

The essential Turing: seminal writings in computing, logic, philosophy, artificial intelligence, and artificial life plus the secrets of enigma.

Oxford University Press, 2004.

beamericonarticleH. Thimbleby, S Anderson and P. Cairns

A Framework for Modelling Trojans and Computer Virus Infection.

Computer Journal, 41: 444-458, 1998.

(54)

beamericonarticleE. Mäkinen

Comment on ‘A framework for modelling trojans and computer virus infection’.

Computer Journal, 44(4): 321-323, 2001.

Cytaty

Powiązane dokumenty

The problem of choosing the regres- sion order for least squares estimators in the case of equidistant observation points was investigated in [4].. In order to investigate

Lita da Silva, Sufficient conditions for the strong consis- tency of least squares estimator with α-stable errors, Discussiones Mathe- maticae - Probability and Statistics 27

and [9]. Generally, if X is an algebraic set of pure dimension n ≥ 1, X is said to be uniruled if every component of X is uniruled. Points at which a polynomial map is not proper.

2. 2% of newly manufactured processors have damaged cores. A laptop with a damaged core overheats; overheating also appears in 0.002% of laptops with fully functional cores. We

An adsorption isotherm for a single gaseous adsorbate on a solid is the function which relates at constant temperature the amount of substance adsorbed at equilibrium to

A concert choir is arranged, per row, according to an arithmetic sequence.. There are 20 singers in the fourth row and 32 singers in the

It is an acitivity of the Society of Reliability, Quality and Safety and is organized by the Department of Math- ematics of Wrocław UoT, in collaboration with the Institute

• “Nowy Sącz Experiment” in the end of 50’s and 60’s years and its influence on city's innovation,.. • 7 economical “tigers” – there is always somebody behind