UNLAWFUL will be coded as:
24481236
Observations:
• All words have 8 letters and all codes have 8 digits, which might be coincidence.
• Only one of the letters in UNLAWFUL is in PRESERVE or COMMENCE.
• There is no direct correspondence of letters to digits.
• The digit 9 doesn't occur; 2 occurs four times; 1 occurs three times.
Some thoughts:
Splitting the numbers into prime factors does not yield any useful result. (The code might be the product of distinct primes, e.g. A = 2; B = 3; C = 5; ...; z = 101, but it isn't.)
The many 1's and 2's could mean that the code are just the alphabetical indices run together,so that CAT might be 3120. Of course, the code would usually be longer than the original word, but perhaps synonyms (start?, jelly?, illicit?) have been encoded. That's another dead end.
Making inroads:
All words and codes have an even number of letters. Let's split them into pairs:
CO
MM
EN
CE
PR
ES
ER
VE
18
25
16
24
18
32
36
20
All numbers are composite. And code for the double letter MM is a square! (The codes for 16 and 36 are not double letters, but they could be 2×8 or 4×9. CO and PR share a code, but there are also several ways to get a product of 18.)
So, let's go with this for now: Each letter has a numerical value and the code for a pair of letters is the product of their values. This isn't hard to solve:
C = 6
E = 4
M = 5
N = 4
O = 3
P = 2
R = 9
S = 8
V = 5
Some letters get the same value, but that's probably okay. The code isn't unique anyway, since AB yields the same product as BA.
Unfortunately, that doesn't help with UNLAWFUL, because we don't have the numerical value of any of its letters except of N.
Wrapping it up:
Let's make a little table:
1
2
3
4
5
6
7
8
9
P
O
E
M
C
S
R
N
V
Is there a password that we can use to find the numerical value of each letter? Or some other pattern? Let's tretch this out a bit:
1
2
3
4
5
6
7
8
9
E
C
P
O
N
M
S
R
V
Now it's easy to see what's going on here. The compete table is:
1
2
3
4
5
6
7
8
9
H
G
F
E
D
C
B
A
.
Q
P
O
N
M
L
K
J
I
Z
Y
X
W
V
U
T
S
R
With this table and the rule to multiply the letter codes pairwise, we get:
UN
LA
WF
UL
24
48
12
36
What happens when a word has an odd number of letters or when the product is smaller than 10? I don't know and I don't care – it's not part oft the assignment. :)