-/* jbirth: A Tool for Comparing Birthmarks Extracted from Java Class Files
- * Copyright (C) 2003-2004 Haruaki TAMADA
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
package jp.naist.se.stigmata;
/*
import java.util.List;
/**
- * Abstract class for concrete [@link Birthmark <code>Birthmark</code>}
+ * Abstract class for concrete {@link Birthmark <code>Birthmark</code>}
* @author Haruaki TAMADA
* @version $Revision$ $Date$
*/
/**
* @return elements
- * @uml.property name="elements"
*/
public BirthmarkElement[] getElements(){
return elements.toArray(new BirthmarkElement[elements.size()]);
/**
* This method check types of this birthmark and given birthmark are matched.
*
- * @param b check target.
+ * @param birthmark check target.
* @return true: same type, false: not same type.
*/
public boolean isSameType(Birthmark birthmark);
\r
/**\r
* return all birthmark services searching traverse to root context.\r
- * @uml.property name="services"\r
*/\r
public synchronized BirthmarkSpi[] getServices(){\r
List<BirthmarkSpi> list = getServiceList();\r
/**
* return the value of this element.
- * @uml.property name="value"
*/
public Object getValue(){
return value;
\r
/**\r
* return the context.\r
- * @uml.property name="context"\r
*/\r
public BirthmarkContext getContext(){\r
return context;\r
/**\r
* return a target.\r
* @see #getTarget2()\r
- * @uml.property name="target1"\r
*/\r
public BirthmarkSet getTarget1(){\r
return target1;\r
/**\r
* return other target\r
* @see #getTarget1()\r
- * @uml.property name="target2"\r
*/\r
public BirthmarkSet getTarget2(){\r
return target2;\r
\r
/**\r
* @return similarity\r
- * @uml.property name="similarity"\r
*/\r
public double getSimilarity(){\r
return similarity;\r
package jp.naist.se.stigmata;\r
\r
+/*\r
+ * $Id$\r
+ */\r
+\r
import java.util.ArrayList;\r
import java.util.Iterator;\r
import java.util.List;\r
\r
\r
+/**\r
+ * Set of {@link ComparisonPairFilter <Ccode>ComparisonPairFilter</code>}.\r
+ *\r
+ * @author Haruaki TAMADA\r
+ * @version $Revision$ $Date$\r
+ */\r
public class ComparisonPairFilterSet implements Iterable<ComparisonPairFilter>{\r
private List<ComparisonPairFilter> filters = new ArrayList<ComparisonPairFilter>();\r
private String name;\r
import org.objectweb.asm.ClassWriter;\r
\r
/**\r
+ * Abstract birthmark extractor using ASM.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
super();\r
}\r
\r
- public abstract BirthmarkExtractVisitor createExtractVisitor(ClassWriter writer, Birthmark birthmark, BirthmarkContext context);\r
+ public abstract BirthmarkExtractVisitor\r
+ createExtractVisitor(ClassWriter writer, Birthmark birthmark, BirthmarkContext context);\r
\r
@Override\r
- public Birthmark extract(InputStream in, BirthmarkContext context) throws BirthmarkExtractionException{\r
+ public Birthmark extract(InputStream in,\r
+ BirthmarkContext context) throws BirthmarkExtractionException{\r
BirthmarkExtractionException bee = new BirthmarkExtractionException();\r
\r
try{\r
import jp.naist.se.stigmata.utils.LocalizedDescriptionManager;\r
\r
/**\r
+ * Abstract class for {@link BirthmarkSpi <code>BirthmarkSpi</code>}\r
+ *\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
*/\r
import org.objectweb.asm.ClassVisitor;\r
\r
/**\r
- * \r
- * \r
+ * Abstract visitor class of extracting birthmarks from class file.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
*/\r
-public class BirthmarkExtractVisitor extends ClassAdapter{\r
+public abstract class BirthmarkExtractVisitor extends ClassAdapter{\r
private BirthmarkContext context;\r
private List<Throwable> causes = new ArrayList<Throwable>();\r
\r
import jp.naist.se.stigmata.spi.BirthmarkSpi;\r
\r
/**\r
- * Birthmark Service Provider Interface.\r
+ * Service provider interface for birthmarks which are defined in\r
+ * configuration files.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision: 20 $ $Date: 2007-01-17 11:06:01 +0900 (Wed, 17 Jan 2007) $\r
import jp.naist.se.stigmata.BirthmarkElement;\r
\r
/**\r
+ * Null birthmark element.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$ \r
import jp.naist.se.stigmata.AbstractBirthmark;\r
\r
/**\r
+ * Implementation of plain birthmark.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
package jp.naist.se.stigmata.spi;\r
\r
-import java.util.Locale;\r
+/*\r
+ * $Id$\r
+ */\r
\r
+import java.util.Locale;\r
\r
+/**\r
+ * Base abstract class for birthmark SPI.\r
+ *\r
+ * @author Haruaki TAMADA\r
+ * @version $Revision$ $Date$\r
+ */\r
public abstract class AbstractServiceProvider implements ServiceProvider{\r
\r
+ /**\r
+ * returning implementation vendor name of this SPI.\r
+ */\r
public String getDescription(){\r
return getDescription(Locale.getDefault());\r
}\r
\r
+ /**\r
+ * returning implementation vendor name of this SPI.\r
+ */\r
public String getVendorName(){\r
return getClass().getPackage().getImplementationVendor();\r
}\r
\r
+ /**\r
+ * returning version of this SPI.\r
+ */\r
public String getVersion(){\r
return getClass().getPackage().getImplementationVersion();\r
}\r
import jp.naist.se.stigmata.BirthmarkComparator;\r
\r
/**\r
- * Birthmark Service Provider Interface.\r
+ * Service provider interface for comparing birthmarks.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision: 20 $ $Date: 2007-01-17 11:06:01 +0900 (Wed, 17 Jan 2007) $\r
import jp.naist.se.stigmata.BirthmarkExtractor;\r
\r
/**\r
- * Birthmark Service Provider Interface.\r
+ * Service provider interface for extracting birhtmark from given class files.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision: 20 $ $Date: 2007-01-17 11:06:01 +0900 (Wed, 17 Jan 2007) $\r
import jp.naist.se.stigmata.BirthmarkExtractor;\r
\r
/**\r
- * Birthmark Service Provider Interface.\r
+ * Birthmark service provider interface.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
import jp.naist.se.stigmata.ComparisonPairFilter;\r
\r
/**\r
+ * Service provider interface for filtering comparison pair.\r
* \r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
import jp.naist.se.stigmata.format.BirthmarkServiceListFormat;\r
\r
/**\r
- * comparison/extracting result output service.\r
+ * Service provider interface for printing comparison/extracting\r
+ * result to certain output stream.\r
*\r
* @author Haruaki TAMADA\r
* @version $Revision$ $Date$\r
package jp.naist.se.stigmata.spi;\r
\r
+/*\r
+ * $Id$\r
+ */\r
+\r
import java.util.Locale;\r
\r
+/**\r
+ * Base interface for birthmark SPI.\r
+ *\r
+ * @author Haruaki TAMADA\r
+ * @version $Revision$ $Date$\r
+ */\r
public interface ServiceProvider{\r
public String getDescription(Locale locale);\r
\r
\r
http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi/?root=stigmata\r
\r
-Related Publications\r
-\r
- * Haruaki Tamada, Yuichiro Kanzaki, Masahide Nakamura, Akito Monden,\r
- Ken-ichi Matsumoto, "A method for extracting program fingerprints\r
- from Java class files," The Institute of Electronics, Information\r
- and Communication Engineers Technical Report, Vol. ISEC2003-29,\r
- pp.127-133, July 2003. (in Japanese)\r
-\r
- * Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
- Matsumoto, "Detecting the theft of programs using birthmarks,"\r
- Information Science Technical Report, NAIST-IS-TR2003014, ISSN\r
- 0919-9527, Graduate School of Information Science, Nara Institute\r
- of Science and Technology, November 2003.\r
-\r
- * Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
- Matsumoto, "Design and evaluation of birthmarks for detecting theft\r
- of Java programs," Proc. IASTED International Conference on\r
- Software Engineering\r
- ({{{http://www.iasted.org/conferences/2004/Innsbruck/se.htm}IASTED\r
- SE 2004}}), pp.569-575, Innsbruck,\r
- Austria, 17-19 February 2004.\r
-\r
- * Masateru Tsunoda, Takeshi Kakimoto, Naoki Ohsugi, Akito Monden, and\r
- Ken-ichi Matsumoto, "Javawock: A Java Class Recommender System\r
- Based on Collaborative Filtering," In Proc. of 17th International\r
- Conference on Software Engineering and Knowledge Engineering\r
- ({{{http://www.ksi.edu/seke/seke05.html}SEKE2005}}), pp.491-497,\r
- July 2005. (Taipei, Taiwan)\r
-\r
- * Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
- Matsumoto, "Java Birthmarks --Detecting the Software Theft--,"\r
- IEICE Transactions on Information and Systems, Vol. E88-D, No. 9,\r
- September 2005.\r
-\r
- * Takesi Kakimoto, Akito Monden, Yasutaka Kamei, Haruaki Tamada,\r
- Masateru Tsunoda, and Ken-ichi Matsumoto, "Using Software\r
- Birthmarks to Identify Similar Classes and Major Functionalities,"\r
- In Proc. the 3rd International Workshop on Mining Software\r
- Repositories ({{{http://msr.uwaterloo.ca/msr2006/}MSR Mining\r
- Challenge 2006}}), pp.171--172, Shanghai, China, May\r
- 2006.\r
-\r
Related Tools\r
\r
*Watermarking Tools\r
\r
Contact\r
\r
- Contact me by emal \<harua-t[ at ]is.naist.jp\>.\r
+ Contact us by emal \<harua-t[ at ]is.naist.jp\>.\r
\r
*{{{http://sourceforge.jp/developer/sendmessage.php?touser=587}Email sending form}}\r
\r
--- /dev/null
+ ----\r
+ Technical Note\r
+ ----\r
+ Haruaki Tamada\r
+ ----\r
+ 2007-05-11\r
+ ----\r
+\r
+What is Birthmark\r
+\r
+*Definition of birthmark\r
+\r
+ Let <p, q> be programs and <f(p)> be a set of characteristics\r
+extracted from <p> by a certain method <f>. Then <f(p)> is called a\r
+<<birthmark>> of <p> iff both of the following conditions are\r
+satisfied.\r
+\r
+ [[1]] <f(p)> is obtained from <p> itself without any extra information.\r
+\r
+ [[2]] If <q> is a copy of <p>, then <f(p) = f(q)>\r
+\r
+ []\r
+\r
+ Condition 1 means that the birthmark is not extra information and is\r
+required for <p> to run. Hence, extracting a birthmark does not\r
+require extra code as watermarking does. Condition 2 states that the\r
+same birthmark has to be obtained from copied programs. By\r
+contraposition, if birthmarks <f(p)> and <f(q)> are different, then we\r
+can guarantee that <q> is not a copy of <p>.\r
+\r
+ Hopefully, a birthmark will satisfy the following properties.\r
+\r
+ [Property 1 (Preservation)] For <p'> obtained from $p$ by any program\r
+transformation, <f(p) = f(p')> holds.\r
+\r
+ [Property 2 (Distinction)] For <p> and <q> such that both programs have\r
+same specification, if <p> and <q> are written\r
+independently, then <f(p) != f(q)>.\r
+\r
+ []\r
+\r
+ These properties strengthen Condition 2 of birthmark definition.\r
+Property 1 specifies the <<preservation property>> of the birthmark\r
+against program transformation. We believe that clever crackers may\r
+try to modify birthmarks by transforming the original program into an\r
+equivalent one to hide the fact of theft. There are several automated\r
+tools used to perform the transformation, involving program\r
+<obfuscators> and <optimizers>. These tools can be used as a means of\r
+attack against the birthmarks. Property 1 specifies that the same\r
+birthmark must be obtained from <p> and converted to <p'>. However,\r
+there exist many ways to transform a program into an equivalent\r
+one. Hence, in reality, it is difficult to extract strong enough\r
+birthmarks to perfectly satisfy Property 1.\r
+\r
+ Property 2 specifies the <<distinction property>> of the birthmark,\r
+stating that: even though the specification of <p> and <q> is the\r
+same, if implemented separately, different birthmarks should be\r
+extracted. In general, the detail of two independent programs is\r
+almost never completely the same. However, in the case that <p> and\r
+<q> are both <<tiny>> programs, extracted birthmarks could become the\r
+same, even if <p> and <q> are written independently. Those properties\r
+should be tuned within an allowable range at the user's discretion.\r
+\r
+Implemented Birthmarks\r
+\r
+*CVFV birthmark\r
+\r
+ [Proposers] H. Tamada, et al.\r
+\r
+ [Paper] Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Java Birthmarks --Detecting the Software Theft--," IEICE\r
+ Transactions on Information and Systems, Vol. E88-D, No. 9, September\r
+ 2005.\r
+\r
+*SMC birthmark\r
+\r
+ [Proposers] H. Tamada, et al.\r
+\r
+ [Paper] Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Java Birthmarks --Detecting the Software Theft--," IEICE\r
+ Transactions on Information and Systems, Vol. E88-D, No. 9, September\r
+ 2005.\r
+\r
+*IS birthmark\r
+\r
+ [Proposers] H. Tamada, et al.\r
+\r
+ [Paper] Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Java Birthmarks --Detecting the Software Theft--," IEICE\r
+ Transactions on Information and Systems, Vol. E88-D, No. 9, September\r
+ 2005.\r
+\r
+*UC birthmark\r
+\r
+ [Proposers] H. Tamada, et al.\r
+\r
+ [Paper] Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Java Birthmarks --Detecting the Software Theft--," IEICE\r
+ Transactions on Information and Systems, Vol. E88-D, No. 9, September\r
+ 2005.\r
+\r
+*k-gram based birthmark\r
+\r
+ [Proposers] G. Myles and C. Collberg\r
+\r
+ [Paper] Ginger Myles, Christian Collberg, ``K-gram based software\r
+ birthmarks,'' In Proc. of the 2005 ACM symposium on Applied\r
+ computing, 2005.\r
+\r
+\r
+Related Publications\r
+\r
+ * Haruaki Tamada, Yuichiro Kanzaki, Masahide Nakamura, Akito Monden,\r
+ Ken-ichi Matsumoto, "A method for extracting program fingerprints\r
+ from Java class files," The Institute of Electronics, Information\r
+ and Communication Engineers Technical Report, Vol. ISEC2003-29,\r
+ pp.127-133, July 2003. (in Japanese)\r
+\r
+ * Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Detecting the theft of programs using birthmarks,"\r
+ Information Science Technical Report, NAIST-IS-TR2003014, ISSN\r
+ 0919-9527, Graduate School of Information Science, Nara Institute\r
+ of Science and Technology, November 2003.\r
+\r
+ * Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Design and evaluation of birthmarks for detecting theft\r
+ of Java programs," Proc. IASTED International Conference on\r
+ Software Engineering\r
+ ({{{http://www.iasted.org/conferences/2004/Innsbruck/se.htm}IASTED\r
+ SE 2004}}), pp.569-575, Innsbruck,\r
+ Austria, 17-19 February 2004.\r
+\r
+ * Masateru Tsunoda, Takeshi Kakimoto, Naoki Ohsugi, Akito Monden, and\r
+ Ken-ichi Matsumoto, "Javawock: A Java Class Recommender System\r
+ Based on Collaborative Filtering," In Proc. of 17th International\r
+ Conference on Software Engineering and Knowledge Engineering\r
+ ({{{http://www.ksi.edu/seke/seke05.html}SEKE2005}}), pp.491-497,\r
+ July 2005. (Taipei, Taiwan)\r
+\r
+ * Haruaki Tamada, Masahide Nakamura, Akito Monden, and Ken-ichi\r
+ Matsumoto, "Java Birthmarks --Detecting the Software Theft--,"\r
+ IEICE Transactions on Information and Systems, Vol. E88-D, No. 9,\r
+ September 2005.\r
+\r
+ * Takesi Kakimoto, Akito Monden, Yasutaka Kamei, Haruaki Tamada,\r
+ Masateru Tsunoda, and Ken-ichi Matsumoto, "Using Software\r
+ Birthmarks to Identify Similar Classes and Major Functionalities,"\r
+ In Proc. the 3rd International Workshop on Mining Software\r
+ Repositories ({{{http://msr.uwaterloo.ca/msr2006/}MSR Mining\r
+ Challenge 2006}}), pp.171--172, Shanghai, China, May\r
+ 2006.\r
+\r
<menu name="Stigmata">
<item name="Introduction" href="index.html"/>
+ <item name="Technical Note" href="technique.html" />
<item name="License" href="license.html"/>
+ <item name="Download" href="https://sourceforge.jp/projects/stigmata/files/" />
<item name="Project Page" href="http://sourceforge.jp/projects/stigmata/"/>
</menu>