What is the importance of 1 < d < φ(n) and 0 ≤ m < n in RSA? I'm a first year Maths undergraduate and we have recently gone onto RSA. I understand the majority of the algorithm using Fermat's Theorem etc.

From the algorithm stated on Wikipedia:


  4) Choose an integer $d$ such that $1 \lt d \lt φ(n)$ and $\gcd(d, φ(n)) = 1$; i.e., $d$ and $φ(n)$ are coprime.
  
  5) Determine $e$ as $e ≡ d^{−1} \mod {φ(n)}$; i.e., $e$ is the modular multiplicative inverse of $d \mod {φ(n)}$.


I don't understand the importance of $1 &lt; d &lt; φ(n)$.

Also why must the message $M$ to be encrypted be an integer $m$ such that $0 ≤ m &lt; n$ (here $n$ is the product of two distinct primes $p$ and $q$)?
From the algorithm stated on Wikipedia:
&quot;4) Choose an integer d such that 1 &lt; d &lt; φ(n) and gcd(d, φ(n)) = 1; i.e., d and φ(n) are coprime. 5) Determine e as e ≡ d−1 (mod φ(n)); i.e., e is the modular multiplicative inverse of d (modulo φ(n))&quot;
I don't understand the importance of 1 &lt; d &lt; φ(n).

You can use a d greater than φ(n), but it needs more computation time than a d less than φ(n).
Also, d and e in 4) and 5) should be swapped. You may see 8.2.1 Handbook of Applied Cryptography

Also why must the message M to be encrypted be an integer m such that 0 ≤ m &lt; n
(Here n is the product of two distinct primes p and q)

If m is less than 0 or not less than n, you can not recover m; since decryption gives you a number(m') 0 ≤ m' &lt; n.