We will consider balanced directed graphs, i.e., graphs of binary relations, for which the number of inputs and number of outputs are the same for each vertex. The commutative diagram is formed by two directed paths for which the same starting and ending points form the full list of common vertices. We refer to the length of the maximal path (the number of arrows) as the rank of the diagram. We will count a directed cycle of length m as a commutative diagram of rank m. We define the girth indicator gi, gi 2 of the directed graph as the minimal rank of its commutative diagram. We observe briefly the applications of finite automata related to balanced graphs of high girth in Cryptography. Finally, for each finite commutative ring K with more than two regular elements we consider the explicit construction of algebraic over K family of graphs of high girth and discuss the implementation of the public key algorithm based on finite automata corresponding to members of the family.