Let Qn be a hypercube of dimension n, that is, a graph whose vertices are binary n-tuples and two vertices are adjacent iff the corresponding n-tuples differ in exactly one position. An edge coloring of a graph H is called rainbow if no two edges of H have the same color. Let f(G, H) be the largest number of colors such that there exists an edge coloring of G with f(G, H) colors such that no subgraph isomorphic to H is rainbow. In this paper we start the investigation of this anti-Ramsey problem by providing bounds on f(Qn, Qk) which are asymptotically tight for k = 2 and by giving some exact results.