Question: I can imagine that finding $p,q,n$ are easy, but my text book also says the $e$ can be found rapidly, so how does modern RSA find this $e$?

![RSA as a Public Key System](https://i.stack.imgur.com/LBR7F.png)

Answer: 
Clarification
-------------

> 
> I'm wondering whether there exists an encoding/hashing/encryption scheme whereby the original string can always be derived in its entirety given the entire encoded/hashed/encrypted string, and nothing else (no key/password). But also, no portion of the original string can be derived given any portion of the encoded/hashed/encrypted string.
> 
> 
> 

I am assuming that "no portion of the original string can be derived given any portion of the encoded/hashed/encrypted string" means "no portion of the original string can be derived given anything less than the entire encoded/hashed/encrypted string", otherwise the question would be self-contradictory.

Answer
------

It sounds like you are looking for a permutation. A permutation is an invertible transformation on a fixed-size set of blocks. If your input is larger, the/an [All-Or-Nothing Transform](https://en.wikipedia.org/wiki/All-or-nothing_transform) may be useful. The OAEP mentioned by @DannyNiu is an example of an AONT.

For example, many block ciphers are built by interleaving applications of a permutation with the addition of secret key material. The permutation provides diffusion, which ensures that if you modify any part of the output then attempt to invert it, you end up back at a completely different input. 

If you simply strip the key addition portion from a block cipher, it should also do what you're asking. For example, [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) consists of subBytes, mixColumns, shiftRows, and addRoundKey. If you were to omit the addRoundkey operation, you would be left with a fixed permutation that provides the required avalanche effect and some degree of unpredictability. Another example of a permutation is [keccak-f](https://en.wikipedia.org/wiki/Keccak#The_block_permutation), which does the mixing for the [SHA3 algorithm](http://en.wikipedia.org/wiki/Keccak).

A key-less permutation does not provide encryption
--------------------------------------------------

Note that such a construction with no key is no longer providing *encryption*, as it is not possible to provide confidentiality of the message without some kind of secrecy, which is what the key provides. If anyone who has an input message can compute an output "ciphertext", or anyone who has an output "ciphertext" can invert it to the input message, then clearly confidentiality of the input cannot be achieved.

You tagged this question with "encoding", so perhaps confidentiality is not required in your use case. You would need to establish what you need this construction for and whether or not this is an issue.
A simple way to achieve this with common algorithms would be to do the following:

1. Choose a random key (key)
2. Encrypt the data using the random key (encrData)
3. Hash the encrypted data (encrHash)
4. Xor the key and the hash (xorKey)
5. The result data would be the encrypted data + the Xor key (encrData+xorKey)

To reverse:

1. Split the data into encrData+xorKey
2. Hash the encrypted data (encrHash)
3. Xor the xorKey with the encrHash Because the way xor works this reverses the process above (key)
4. Decrypt the data with the key

If needed base64 the encrypted data to produce string form

With this scheme you will need the entire string to decrypt the data and can use any secure algorithm (ex AES and SHA256)