Banks loan money to each and borrow money from each other. To minimizing the risk caused by a possible default of one of the banks, a reasonable idea is to evenly spread the lending between different banks. A natural way to formalize this evenness requirement is to select the interbank amounts for which the entropy is the largest possible. The existing algorithms for solving the resulting constrained optimization problem provides only an approximate solution. In this paper, we propose a new algorithm that provides the exact solution to the maximum-entropy interbank lending problem.