How are "string-messages" converted to "number-messages"? Textbooks most of the time assume that a message, say "secret", is already represented in number format, say "8614" (just as an example!). But how exactly is this conversion achieved?

I imagine it to happen something like that:


"secret" is converted into the binary format, say "1001001" (names like ASCII or UTF-8 come to my mind, though I am not sure)
1001001 is somehow converted into a number, in above example "8614"


Could you please give me more details or some references so I can look it up?
Cryptographic schemes handle byte strings. To convert a string to a byte string, you need some encoding like ASCII (which can't handle every character) or UTF-8 (which can handle the entire Unicode).

Some specific schemes, like RSA, do need to interpret the byte string as a number. This process is defined in the scheme specification (e.g. for RSA, the PKCS#1 standard - see the OS2IP conversion function). In RSA, the byte string is read as a big endian number in base 256. For example, the byte string 0x01 0x02 is interpreted as the number 258 (256 * 1 + 2).