Implementation of Kamasutra cipher
The implementation looks good, I just have a few suggestions.
Single-responsibility principle
The method encrypt seems to have a lot of responsibility:

Reads the input from the user
Encrypts the input
Outputs the result to the console

One definition of SRP is &quot;A class should have only one reason to change&quot;. But there are many reasons for KamasutraCipher to change:

The input may come from System.in, file, database, etc.
The library StdIn changes.
The output needs to go to a file, etc.
The output needs to be formatted nicely for the user
etc..

The only responsibility of KamasutraCipher should be to encrypt (or decrypt) a string and return the result.
The interface can be refactored from this:
public class KamasutraCipher {
    public static void encrypt(String s, String t)
}

To:
public class KamasutraCipher {
    public KamasutraCipher(String key1, String key2)
    public String encrypt(String s)
}

Now the only reason for KamasutraCipher to change is for optimizations or if the Kamasutra algorithm changes, but the latter is not going to happen soon.
All the logic for requesting the input and producing the output is pushed to the main.
Strings are immutable
In Java strings are immutable objects, and any modification to a string creates a new string. Therefore this part:
String temp = word;
word = temp.substring(0,i) + String.valueOf(t.charAt(j)) + temp.substring(i+1);

Can be changed to:
word = word.substring(0,i) + t.charAt(j) + word.substring(i+1);

Optimization
The complexity of the method encrypt is O(m*n) where m is the length of the input string and n is the length of the key. (ignoring the methods of String and the while loop).
A more efficient way would be to use a map to store the string keys. For example, given the string keys ABC and FGH, the map would contain:

A -&gt; F
B -&gt; G
C -&gt; H
F -&gt; A
G -&gt; B
H -&gt; C

The method encrypt then becomes a simple lookup on the map, reducing the complexity  to O(m):
public String encrypt(String s) {
    StringBuilder sb = new StringBuilder(s.length());
    for (int i = 0; i &lt; s.length(); i++) {
        Character c = s.charAt(i);
        sb.append(keyMap.get(c));
    }
    return sb.toString();
}

SpringBuilder lets us save some memory by creating the result string more efficiently. keyMap is created in the constructor because the keys don't change after initialization.
Input validation

any letter in standard input must appear in exactly one of them (keys)

As mentioned by others this is a requirement that needs to be handled, possibly in the method encrypt.
For the exceptions you can use IllegalArgumentException instead of RuntimeException.
Refactored code
public class KamasutraCipher {
    
    private final Map&lt;Character,Character&gt; keyMap;
    
    public KamasutraCipher(String key1, String key2) {
        if (key1.length() != key2.length()) {
            throw new IllegalArgumentException(&quot;The key lengths must be equal&quot;);
        }
        keyMap = new HashMap&lt;&gt;();
        for (int i = 0; i &lt; key1.length(); i++) {
            keyMap.put(key1.charAt(i), key2.charAt(i));
            keyMap.put(key2.charAt(i), key1.charAt(i));
        }
    }
    
    public String encrypt(String s) {
        StringBuilder sb = new StringBuilder(s.length());
        for (int i = 0; i &lt; s.length(); i++) {
            Character c = s.charAt(i);
            if(!keyMap.containsKey(c)) {
                throw new IllegalArgumentException(String.format(&quot;'%c' is not in the keys&quot;, c));
            }
            sb.append(keyMap.get(c));
        }
        return sb.toString();
    }

    public static void main(String[] args) {
        KamasutraCipher cipher = new KamasutraCipher(args[0], args[1]);
        while (!StdIn.isEmpty()) {
            String input = StdIn.readString();
            System.out.println(cipher.encrypt(input));
        }
    }
}