This paper is devoted to new algebraic structures, called qualgebras and squandles. Topologically, they emerge as an algebraic counterpart of knotted 3-valent graphs, just like quandles can be seen as an "algebraization" of knots. Algebraically, they are modeled after groups with conjugation and multiplication/squaring operations. We discuss basic properties of these structures, and introduce and study the notions of qualgebra/squandle 2-cocycles and 2-coboundaries. Knotted 3-valent graph invariants are constructed by counting qualgebra/squandle colorings of graph diagrams, and are further enhanced using 2-cocycles. A classification of size 4 qualgebras/squandles and a description of their second cohomology groups are given.